Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xkeysnail and keyswap are failing #279

Closed
abhi-iyer opened this issue Sep 24, 2020 · 7 comments
Closed

xkeysnail and keyswap are failing #279

abhi-iyer opened this issue Sep 24, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@abhi-iyer
Copy link

abhi-iyer commented Sep 24, 2020

I'm trying to run Kinto with a Logitech K860 (not sure if this is relevant or not). Although it's not an official Apple keyboard, the keyboard layout is identical to an official Apple keyboard, so I'm running it with "Option 2".

The keyswap service and the xkeysnail services are failing, which means the remap is not working.

Here is the installation log:

Kinto - Type in Linux like it's a Mac.

1) Kinto - xkeysnail (udev/x11) - Recommended
2) Kinto - Original xkb/x11 implementation
3) Uninstall Kinto - xkeysnail
4) Uninstall Kinto - Original xkb

1

Install Kinto - xkeysnail (udev)
  1) Windows & Mac (HID driver) - Most Standard keyboards (& 1st party usb/bt Apple keyboards)
  2) Mac Only & VMs on Macbooks - 3rd & 1st party Apple keyboards
  3) Chromebook - Chromebook running Linux
2

Do you want multi-language on Right Alt key? (y/N)
aka Left side remaps, right side doesn't
n

Would you like to give VS Code Sublime Text keymaps? (y/N)
n

Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right) disabled on master w/ xkeysnail 

Service file added to /usr/lib/systemd/system/xkeysnail.service
Ownership set for root...
Permissions set to 644...
Created soft symlink...
ln: failed to create symbolic link '/etc/systemd/system/graphical.target.wants/xkeysnail.service': File exists
Failed to create soft symlink for graphical target...
localuser:root being added to access control list
fatal: destination path 'xkeysnail' already exists and is not an empty directory.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Already up to date.
HEAD is now at 51c3690 Update version to 0.3.0
Processing /home/abhiram/Documents/kinto/xkeysnail
Requirement already satisfied, skipping upgrade: evdev in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (1.3.0)
Requirement already satisfied, skipping upgrade: inotify_simple in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (1.3.5)
Requirement already satisfied, skipping upgrade: python-xlib in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (0.27)
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/lib/python3/dist-packages (from python-xlib->xkeysnail==0.3.0) (1.14.0)
Building wheels for collected packages: xkeysnail
  Building wheel for xkeysnail (setup.py) ... done
  Created wheel for xkeysnail: filename=xkeysnail-0.3.0-py3-none-any.whl size=17545 sha256=f42148b724a84de2034cfab22ca76f2017071e62876391fec6098f1dee2c46ac
  Stored in directory: /tmp/pip-ephem-wheel-cache-z4fvlje9/wheels/cc/a1/f5/da9fcec6333979ce9608b011437c343c8d20078e358c143b0c
Successfully built xkeysnail
Installing collected packages: xkeysnail
  Attempting uninstall: xkeysnail
    Found existing installation: xkeysnail 0.3.0
    Uninstalling xkeysnail-0.3.0:
      Successfully uninstalled xkeysnail-0.3.0
Successfully installed xkeysnail-0.3.0
Adding xhost fix...

Kinto install is complete.

Kinto xkeysnail service is running.

Commands for controlling Kinto's xkeysnail service
sudo systemctl restart xkeysnail
sudo systemctl stop xkeysnail
sudo systemctl start xkeysnail
sudo systemctl status xkeysnail


If Kinto is already running it will be stopped...
If you cancel the installer you can re-run Kinto via
 systemctl --user start keyswap
Failed to stop keyswap.service: Unit keyswap.service not loaded.

Detected Ubuntu 20.04 DE: gnome

Do you want to apply system level shortcuts? (Y/n) y

Any attempt to restart/stop/start xkeysnail results in the following message:

Failed to restart xkeysnail.service: Unit xkeysnail.service not found.

The logs for keyswap:

Sep 24 14:02:03 abhiram-desktop systemd[1433]: /home/abhiram/.config/systemd/user/keyswap.service:11: WorkingDirectory= path is not absolute: {homedir}/.config/kinto
Sep 24 14:02:03 abhiram-desktop systemd[1433]: keyswap.service: Unit configuration has fatal error, unit will not be started.
Sep 24 14:02:03 abhiram-desktop systemd[1433]: /home/abhiram/.config/systemd/user/keyswap.service:11: WorkingDirectory= path is not absolute: {homedir}/.config/kinto
Sep 24 14:02:03 abhiram-desktop systemd[1433]: keyswap.service: Unit configuration has fatal error, unit will not be started.
Sep 24 14:11:36 abhiram-desktop systemd[1433]: /home/abhiram/.config/systemd/user/keyswap.service:11: WorkingDirectory= path is not absolute: {homedir}/.config/kinto
Sep 24 14:11:36 abhiram-desktop systemd[1433]: keyswap.service: Unit configuration has fatal error, unit will not be started.
Sep 24 14:11:46 abhiram-desktop systemd[1433]: /home/abhiram/.config/systemd/user/keyswap.service:11: WorkingDirectory= path is not absolute: {homedir}/.config/kinto
Sep 24 14:11:46 abhiram-desktop systemd[1433]: keyswap.service: Unit configuration has fatal error, unit will not be started.
Sep 24 14:11:53 abhiram-desktop systemd[1433]: /home/abhiram/.config/systemd/user/keyswap.service:11: WorkingDirectory= path is not absolute: {homedir}/.config/kinto
Sep 24 14:11:53 abhiram-desktop systemd[1433]: keyswap.service: Unit configuration has fatal error, unit will not be started.

If I try installation with "Option 1" instead of "Option 2" as listed in the installation guide, the only thing that happens is my Cmd key is swapped with the Option key.

Any help appreciated :)

@abhi-iyer abhi-iyer added the bug Something isn't working label Sep 24, 2020
@rbreaves
Copy link
Owner

rbreaves commented Sep 25, 2020

I’d run the uninstaller for both xkeysnail & the original xkbmap aka Keyswap method.

When installing the recommended xkeysnail version there should not be any mention of Keyswap in your logs (unless I’m unintentionally attempting to remove the older method & it’s simply not there - but I need to update the installer if that’s the case. No harm but doesn’t need to attempt the uninstall unless the old files exist.)

I am confused on why you Cmd key has been swapped by your Alt key.. only time that ought to happen is during an install with the “Windows & Mac” option if you have an official Mac kB, but 2 swaps occur so users don’t notice & they get what they’d expect. Only time 2 swaps don’t happen is if xkeysnail fails & then they’re left w/ 1 - but you shouldn’t have any on Mac only - if xkeysnail fails to run. :/

@abhi-iyer
Copy link
Author

Thanks for the response!

Uninstalling xkeysnail and the original xkbmap version results in these two error statements, respectively:

1) Kinto - xkeysnail (udev/x11) - Recommended
2) Kinto - Original xkb/x11 implementation
3) Uninstall Kinto - xkeysnail
4) Uninstall Kinto - Original xkb

3

Uninstalling Kinto - xkeysnail (udev)

Press R to restore your original shortcuts.
Press F to reset to factory shortcuts. (f/r)
r
Restore original user shortcuts
Restoring DE hotkeys...
dconf load /org/gnome/desktop/wm/keybindings/ < keybindings_2020.09.24-1600979800.conf
dconf load /org/gnome/mutter/keybindings/ < mutter_2020.09.24-1600979800.conf
Gnome hotkeys have been successfully restored.
Removed /etc/systemd/system/xkeysnail.service.
Removed /etc/systemd/system/graphical.target.wants/xkeysnail.service.
rm: cannot remove '/etc/systemd/system/xkeysnail.service': No such file or directory
rm: cannot remove '/etc/systemd/system/graphical.target.wants/xkeysnail.service': No such file or directory
● xkeysnail.service              not-found failed   failed xkeysnail.service   

and

1) Kinto - xkeysnail (udev/x11) - Recommended
2) Kinto - Original xkb/x11 implementation
3) Uninstall Kinto - xkeysnail
4) Uninstall Kinto - Original xkb

4

You selected to Uninstall Kinto.


Your DE is gnome.

Y: Restore hotkeys from backup
N: Reset OS/DE hotkeys
Which option would you prefer? (Y/n) n

Resetting DE hotkeys...

gsettings reset-recursively org.gnome.desktop.wm.keybindings
gsettings reset-recursively org.gnome.mutter.keybindings
gsettings set org.gnome.mutter overlay-key 'super'
./uninstall.sh

Failed to disable unit: Unit file keyswap.service does not exist.
Failed to disable unit: Unit file keyswap.timer does not exist.
rm: cannot remove '/home/abhiram/.config/systemd/user/keyswap.service': No such file or directory
rm: cannot remove '/home/abhiram/.config/systemd/user/keyswap.timer': No such file or directory
Done.

Which means they're not getting uninstalled properly. How would you suggest I best go about this?

Thanks!

@rbreaves
Copy link
Owner

May just be a reflection of it not having installed correctly either. I mean if the files aren’t there then they’re not there. I’ll sit down in front of my computer & read back through your posts a bit later, not sure what to advise at the moment.

@abhi-iyer
Copy link
Author

abhi-iyer commented Sep 26, 2020

Thanks for the tips.
I think I'm onto something, but it's still quite buggy. As of now, the only key mappings that have worked are "Cmd + A", "Cmd + X", and "Cmd + C", and that too, only in the a web browser's search box for some reason. Otherwise, they normally do not work. The rest do not work at any time.

I think xkeysnail is definitely not getting installed correctly. When I manually uninstall xkeysnail (since I can't seem to uninstall it via "Option 3" - it says xkeysnail doesn't exist although it's definitely installed), I'm hoping that "Option 1" installs a fresh xkeysnail for me.

This, is my log. A fresh install is executed, and everything looks fine (I think):

1) Kinto - xkeysnail (udev/x11) - Recommended
2) Kinto - Original xkb/x11 implementation
3) Uninstall Kinto - xkeysnail
4) Uninstall Kinto - Original xkb

1

Install Kinto - xkeysnail (udev)
  1) Windows & Mac (HID driver) - Most Standard keyboards (& 1st party usb/bt Apple keyboards)
  2) Mac Only & VMs on Macbooks - 3rd & 1st party Apple keyboards
  3) Chromebook - Chromebook running Linux
2

Do you want multi-language on Right Alt key? (y/N)
aka Left side remaps, right side doesn't
n

Would you like to give VS Code Sublime Text keymaps? (y/N)
n

Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right) disabled on master w/ xkeysnail 

rm: cannot remove '/etc/systemd/system/xkeysnail.service': No such file or directory
Service file added to /usr/lib/systemd/system/xkeysnail.service
Ownership set for root...
Permissions set to 644...
Created soft symlink...
Created soft symlink for graphical target...
localuser:root being added to access control list
Cloning into 'xkeysnail'...
remote: Enumerating objects: 113, done.
remote: Counting objects: 100% (113/113), done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 113 (delta 68), reused 96 (delta 62), pack-reused 0
Receiving objects: 100% (113/113), 34.37 KiB | 11.46 MiB/s, done.
Resolving deltas: 100% (68/68), done.
Note: switching to '51c369084e0045a8410d227bab52411bf84fb65b'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 51c3690 Update version to 0.3.0
Processing /home/abhiram/Documents/kinto/xkeysnail
Requirement already satisfied, skipping upgrade: evdev in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (1.3.0)
Requirement already satisfied, skipping upgrade: inotify_simple in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (1.3.5)
Requirement already satisfied, skipping upgrade: python-xlib in /usr/local/lib/python3.8/dist-packages (from xkeysnail==0.3.0) (0.27)
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/lib/python3/dist-packages (from python-xlib->xkeysnail==0.3.0) (1.14.0)
Building wheels for collected packages: xkeysnail
  Building wheel for xkeysnail (setup.py) ... done
  Created wheel for xkeysnail: filename=xkeysnail-0.3.0-py3-none-any.whl size=17545 sha256=473142e27f769b47355e8c784fbb459146f257019d5f2d04ce6ff4ff8f7bcdc8
  Stored in directory: /tmp/pip-ephem-wheel-cache-mk3zcnmp/wheels/cc/a1/f5/da9fcec6333979ce9608b011437c343c8d20078e358c143b0c
Successfully built xkeysnail
Installing collected packages: xkeysnail
Successfully installed xkeysnail-0.3.0
Adding xhost fix...

Kinto install is complete.

Kinto xkeysnail service is running.

Commands for controlling Kinto's xkeysnail service
sudo systemctl restart xkeysnail
sudo systemctl stop xkeysnail
sudo systemctl start xkeysnail
sudo systemctl status xkeysnail


If Kinto is already running it will be stopped...
If you cancel the installer you can re-run Kinto via
 systemctl --user start keyswap
Failed to stop keyswap.service: Unit keyswap.service not loaded.

Detected Ubuntu 20.04 DE: gnome


Do you want to apply system level shortcuts? (Y/n) y

The xkeysnail logs:

abhiram@abhiram-desktop:~/Documents/kinto$ sudo systemctl status xkeysnail
● xkeysnail.service - xkeysnail
     Loaded: loaded (/lib/systemd/system/xkeysnail.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-09-25 20:58:56 PDT; 4min 31s ago
    Process: 9929 ExecStartPre=/bin/bash -c /usr/bin/xhost +SI:localuser:root && /sbin/runuser -l abhiram -c /home/abhiram/.config/kinto/prexk.sh (code=exited, status=0/SUCCESS)
   Main PID: 9943 (sudo)
      Tasks: 4 (limit: 38340)
     Memory: 5.2M
     CGroup: /system.slice/xkeysnail.service
             ├─9943 /usr/bin/sudo /bin/bash -c  /home/abhiram/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py
             ├─9946 /bin/bash /home/abhiram/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py
             ├─9948 inotifywait -m -e close_write,moved_to,create,modify /tmp/kinto/xkeysnail
             └─9949 /bin/bash /home/abhiram/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py

Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event11   HDA Intel PCH Front Headphone       ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event12   HDA NVidia HDMI/DP,pcm=3            ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event13   HDA NVidia HDMI/DP,pcm=7            ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event14   HDA NVidia HDMI/DP,pcm=8            ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event15   HDA NVidia HDMI/DP,pcm=9            ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event16   HDA NVidia HDMI/DP,pcm=10           ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event17   HDA NVidia HDMI/DP,pcm=11           ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event18   HDA NVidia HDMI/DP,pcm=12           ALSA
Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event5    py-evdev-uinput                     py-evdev-uinput
Sep 25 20:58:57 abhiram-desktop sudo[9947]: error: no input devices found (do you have rw permission on /dev/input/*?)

So I can verify xkeysnail is running, and keyswap isn't installed. The key mapping, still, for some reason, doesn't seem to take hold.

Take your time, any suggestions welcome. Thanks :)

@rbreaves
Copy link
Owner

rbreaves commented Sep 28, 2020

This bit here is a new one for me.

Sep 25 20:58:57 abhiram-desktop sudo[9947]: /dev/input/event5    py-evdev-uinput                     py-evdev-uinput
Sep 25 20:58:57 abhiram-desktop sudo[9947]: error: no input devices found (do you have rw permission on /dev/input/*?)

I would read through the setup for the official xkeysnail project as I believe there must be a different kind of xhost like command that you need to run..

xhost +SI:localuser:root

And you are running in x11, not wayland? Also what distro are you on? All I really know is that you are using Gnome.

I might even install the official xkeysnail version and see if you can get it running properly or not.
https://github.com/mooz/xkeysnail

@abhi-iyer
Copy link
Author

The xhost +SI:localuser:root solved it for me - thanks so much. I was running on x11 and on Ubuntu 20.04.

@rbreaves
Copy link
Owner

rbreaves commented Oct 3, 2020

Hmmm.. well I’d be curious to learn why that command isn’t running successfully in the service file I setup as it really should be. Closing for now but if you find out why it fails in the 1st place I’ll make an update to try & resolve it.

A which command is ran to find the full path to xhost so the service file should be using that..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants