rbreaves / kinto

Mac-style shortcut keys for Linux & Windows.
http://kinto.sh
GNU General Public License v2.0
4.24k stars 212 forks source link

Doesn't work in kali linux #821

Open rajdude0 opened 11 months ago

rajdude0 commented 11 months ago

Describe the bug First off, Thanks for making such an awesome tool. I Installed Kinto on my Kali machine, the auto keyboard chooser figured that my keyboard is Windows based keyboard, which is correct. But as soon as the Kinto service starts, I can't type anything. Nothing happens when I type or try to switch windows using ALT + TAB, basically, the keyboard doesn't respond at all. As soon as I stop the service from the tray icon. It starts working back again.

Expected behavior Well, it should have worked without any hassle as per the README

Install Type: Bare Metal Distro: Kali Release: 2023.

DE: Gnome Branch: master Commit: git rev-parse --short HEAD

RedBearAK commented 11 months ago

@rajdude0

I'm not the Kinto dev, but I've used it for years and did some contributions to it.

Try this in a terminal and see if there is a useful error message. If the keyboard becomes unresponsive and you can't quit the process with Ctrl+C, you can just close the terminal window (or tab) to kill it.

xhost +SI:localuser:root
sudo xkeysnail --watch ~/.config/kinto/kinto.py

This is a simplified form of the command line run from the systemd service file.

Might want to use the tray icon or GUI app to disable auto-start until you know it's going to work.

rajdude0 commented 11 months ago

@RedBearAK thanks for the response. I ran the above command. As you can see from the output the keystrokes are getting captured but somehow is not effective, I tried CTRL + C to quit and ALT + TAB to switch windows, but nothing happened.

xhost +SI:localuser:root
sudo xkeysnail --watch ~/.config/kinto/kinto.py
localuser:root being added to access control list

██╗  ██╗██╗  ██╗███████╗██╗   ██╗
╚██╗██╔╝██║ ██╔╝██╔════╝╚██╗ ██╔╝
 ╚███╔╝ █████╔╝ █████╗   ╚████╔╝
 ██╔██╗ ██╔═██╗ ██╔══╝    ╚██╔╝
██╔╝ ██╗██║  ██╗███████╗   ██║
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝   ╚═╝
  ███████╗███╗   ██╗ █████╗ ██╗██╗
  ██╔════╝████╗  ██║██╔══██╗██║██║
  ███████╗██╔██╗ ██║███████║██║██║
  ╚════██║██║╚██╗██║██╔══██║██║██║
  ███████║██║ ╚████║██║  ██║██║███████╗
  ╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝╚═══xhost +SI:localuser:root
sudo xkeysnail --watch ~/.config/kinto/kinto.py
localuser:root being added to access control list

██╗  ██╗██╗  ██╗███████╗██╗   ██╗
╚██╗██╔╝██║ ██╔╝██╔════╝╚██╗ ██╔╝
 ╚███╔╝ █████╔╝ █████╗   ╚████╔╝
 ██╔██╗ ██╔═██╗ ██╔══╝    ╚██╔╝
██╔╝ ██╗██║  ██╗███████╗   ██║
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝   ╚═╝
  ███████╗███╗   ██╗ █████╗ ██╗██╗
  ██╔════╝████╗  ██║██╔══██╗██║██║
  ███████╗██╔██╗ ██║███████║██║██║
  ╚════██║██║╚██╗██║██╔══██║██║██║
  ███████║██║ ╚████║██║  ██║██║███═══╝
                             v0.3.0

No keyboard devices specified via (--devices) option.
xkeysnail picks up keyboard-ish devices from the list below:

--------------------------------------------------------------------------------------
Device               Name                                Phys
--------------------------------------------------------------------------------------
/dev/input/event0    Power Button                        PNP0C0C/button/input0
/dev/input/event1    Power Button                        LNXPWRBN/button/input0
/dev/input/event2    Video Bus                           LNXVIDEO/video/input0
/dev/input/event7    PC Speaker                          isa0061/input0
/dev/input/event8    HD-Audio Generic HDMI/DP,pcm=3      ALSA
/dev/input/event9    HD-Audio Generic HDMI/DP,pcm=7      ALSA
/dev/input/event10   HD-Audio Generic HDMI/DP,pcm=8      ALSA
/dev/input/event11   HD-Audio Generic HDMI/DP,pcm=9      ALSA
/dev/input/event12   HD-Audio Generic Mic                ALSA
/dev/input/event13   HD-Audio Generic Headphone          ALSA
/dev/input/event3    SONiX USB DEVICE                    usb-0000:03:00.3-4/input0
/dev/input/event4    SONiX USB DEVICE Consumer Control   usb-0000:03:00.3-4/input1
/dev/input/event5    SONiX USB DEVICE System Control     usb-0000:03:00.3-4/input1
/dev/input/event6    SONiX USB DEVICE Keyboard           usb-0000:03:00.3-4/input1
/dev/input/event14   Bedroom speaker (AVRCP)             f4:c8:8a:a1:34:06
/dev/input/event15   Bluetooth Mouse M336/M337/M535 Mouse f4:c8:8a:a1:34:06
/dev/input/event16   Bluetooth Mouse M336/M337/M535 Consumer Control f4:c8:8a:a1:34:06
/dev/input/event17   Bluetooth Mouse M336/M337/M535 Keyboard f4:c8:8a:a1:34:06
/dev/input/event18   py-evdev-uinput                     py-evdev-uinput

Okay, now enable remapping on the following device(s):

----------------------------------------------------------------------------------
Device               Name                                Phys
----------------------------------------------------------------------------------
/dev/input/event3    SONiX USB DEVICE                    usb-0000:03:00.3-4/input0
/dev/input/event6    SONiX USB DEVICE Keyboard           usb-0000:03:00.3-4/input1
/dev/input/event17   Bluetooth Mouse M336/M337/M535 Keyboard f4:c8:8a:a1:34:06

Watching keyboard devices plug in
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
A
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
S
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
LC-C
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
LC-C
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
RC-TAB
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
RC-TAB
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
LC-C
WM_CLASS 'Terminator' | active keymaps = [Special overrides for terminals, General GUI, Wordwise - not vscode, terminals]
LC-C
RedBearAK commented 11 months ago

@rajdude0

In the xkeysnail README it shows how to specify the device to grab.

https://github.com/mooz/xkeysnail#usage

I would try to give it only this device, and see what happens:

/dev/input/event6    SONiX USB DEVICE Keyboard           usb-0000:03:00.3-4/input1

Something like this (you don't need to repeat the xhost command until you log out/reboot):

sudo xkeysnail config.py --devices /dev/input/event6 'SONiX USB DEVICE Keyboard'

Notice this leaves out the --watch option, so it won't notice any new USB device plugged in, or unplugged.

The syntax could be wrong, I've never really needed to use that CLI option.

If you can't get Kinto to work, disable its auto-start and you can try this closely related project of mine:

https://github.com/RedBearAK/toshy

But if you have issues with it, report them on the Toshy repo:

https://github.com/RedBearAK/toshy/issues

Toshy has worked on a few different distros so far that identify as Debian, which should include Kali Linux. It also works with Wayland+GNOME and Wayland+KDE environments, in case that's something you need. Kinto is still only compatible with X11/Xorg.

rajdude0 commented 11 months ago

The command didn't work. But I tried your repo, toshy, and it is working like a charm. I will play around with the keybinding to get a perfect copy of mac based keyboard layout. Thank you very much for the help @RedBearAK, much appreciated! "Toshy for the win" for Kali users, I guess.

Just a heads up if anybody is trying to install toshy in Kali, you will have to override the distro using --override-distro option, the setup command for that would be

./toshy_setup.py --override-distro "debian"

And you need to restart the machine.

RedBearAK commented 11 months ago

I will play around with the keybinding to get a perfect copy of mac based keyboard layout.

@rajdude0

Make sure in most cases you leave the default shortcuts of the target application alone. Kinto and Toshy try to remap Mac shortcuts onto the defaults of each Linux application. Some users get confused and think they still need to change some shortcuts in the preferences of the target application, but that will interfere with the remaps in the config file. If something isn't working, it should be fixed in the config file.

Glad to hear it's working.