petrstepanov / gnome-macos-remap-wayland

macOS like keyboard remap for GNOME desktop environment. Works with Wayland and X11.
85 stars 11 forks source link

gnome remap service fails to grab keyboard #5

Open bradleyd opened 6 months ago

bradleyd commented 6 months ago

Hey, thanks for putting this out there. I am running this on Arch and the keys are not working. Realized the service does not start with this error:

Mar 05 10:03:54 envy systemd[1]: Started GNOME -> macOS Remap.
Mar 05 10:03:54 envy systemd[1]: gnome-macos-remap.service: Scheduled restart job, restart counter is at 86.
Mar 05 10:03:44 envy gnome-shell[1651]: Window manager warning: Ping serial 3039649 was reused for window 0x600003, previous use was for window W3.
Mar 05 10:03:44 envy systemd[1]: gnome-macos-remap.service: Failed with result 'exit-code'.
Mar 05 10:03:44 envy systemd[1]: gnome-macos-remap.service: Main process exited, code=exited, status=1/FAILURE
Mar 05 10:03:44 envy xremap[15536]: Error: Failed to prepare input devices: No device was selected!
Mar 05 10:03:44 envy xremap[15536]: ------------------------------------------------------------------------------
Mar 05 10:03:44 envy xremap[15536]: Failed to grab device 'Keychron K10' at '/dev/input/event6' due to: Resource busy (os error 16)
Mar 05 10:03:42 envy xremap[15536]: Selected keyboards automatically since --device options weren't specified:
Mar 05 10:03:42 envy xremap[15536]: ------------------------------------------------------------------------------
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event9 : HD-Audio Generic HDMI/DP,pcm=7
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event8 : HD-Audio Generic HDMI/DP,pcm=3
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event7 : xremap
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event6 : Keychron K10
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event5 : Generic Blue Microphones
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event4 : Generic Blue Microphones Consumer Control
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event3 : Video Bus
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event2 : PC Speaker
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event18: Logitech MX Master 3S for Mac
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event16: HD-Audio Generic Front Headphone
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event15: HD-Audio Generic Line Out
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event14: HD-Audio Generic Line
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event13: HD-Audio Generic Rear Mic
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event12: HD-Audio Generic Front Mic
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event11: HD-Audio Generic HDMI/DP,pcm=9
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event10: HD-Audio Generic HDMI/DP,pcm=8
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event1 : Power Button
Mar 05 10:03:42 envy xremap[15536]: /dev/input/event0 : Power Button

Any ideas?

petrstepanov commented 6 months ago

Hi, after the install - can you specify the device explicitly in ~/.local/bin/gnome-macos-remap.sh. On line 4 change this

pkexec xremap remap /usr/local/share/gnome-macos-remap/config.yml

to this:

pkexec xremap remap --device /dev/input/event6 /usr/local/share/gnome-macos-remap/config.yml

and reboot?

bradleyd commented 5 months ago

Thanks for getting back to me. That file does not exist in the repo or on my computer.

bradleyd commented 5 months ago

OK, got it to work by it running as root. Moved unit file to global systemd dir and it now works. Maybe something with Arch?