bulletmark / libinput-gestures

Actions gestures on your touchpad using libinput
3.93k stars 241 forks source link

ydotool instead of xdotool for wayland #342

Closed GlitchyCrafting closed 1 year ago

GlitchyCrafting commented 1 year ago

I noticed there was no mention of ydotool as an alternative to xdotool on Wayland. It's not a complete replacement, but for gestures it has all it needs.

bulletmark commented 1 year ago

This has been brought up previously as issue #271. At that time I commented that it was essentially unmaintained but it looks like it has been adopted and refactored since then. However, the documentation is still poor and from what I can tell it has to be run as root which makes it practically unusable. How do you run/use it?

GlitchyCrafting commented 1 year ago

This has been brought up previously as issue #271. At that time I commented that it was essentially unmaintained but it looks like it has been adopted and refactored since then. However, the documentation is still poor and from what I can tell it has to be run as root which makes it practically unusable. How do you run/use it?

In my testing it does not need to be run as root and was made to be a drop-in replacement for xdotool. All I did was replace xdotool with ydotool in the config and it worked as expected to sent keystrokes.

bulletmark commented 1 year ago

As the instructions say, when you raise a bug please provide the output of libinput-gestures -l so I can see what environment you are using.

GlitchyCrafting commented 1 year ago
libinput-gestures: session unknown+wayland on Linux-6.0.8-arch1-1-x86_64-with-glibc2.36, python 3.10.8, libinput 1.22.0
Hash: 8d8b6a109b84473e049faaf97c63aa33
Gestures configured in ~/.config/libinput-gestures.conf:
swipe up         3 ydotool key super+Right
swipe down       3 ydotool key super+Left
swipe left       3 alacritty
libinput-gestures: device /dev/input/by-path/pci-0000:00:15.1-platform-i2c_designware.1-event-mouse(event12): ELAN0722:00 04F3:3139 Touchpad
libinput-gestures is installed.
libinput-gestures is set up as a desktop application.
libinput-gestures is currently running as a desktop application.
libinput-gestures is set to autostart as a desktop application.
libinput-gestures is using custom configuration file.
bulletmark commented 1 year ago

Sorry have been away for much of the last couple of months. Which desktop are you using and What does super+Right/Left do?

GlitchyCrafting commented 1 year ago

I was trying to make a touchscreen-compatible Sway desktop config. Those were to switch between apps in portrait mode, similar to a Right/Left swipe on a phone's gesture-bar.

bulletmark commented 1 year ago

You say "All I did was replace xdotool with ydotool in the config and it worked as expected to sent keystrokes" but I can't see how that could possibly work because the README says you must be running the ydotoold daemon. Are you running that?

Even when I run ydotoold (and there is zero documentation how to do that) it reports nothing and I get no errors from ydotool either but it does not work.

GlitchyCrafting commented 1 year ago

I didn't start the daemon if one was running. I don't have that system anymore, so I can't check.

bulletmark commented 1 year ago

Since the start of 2022, ydotool has required ydotoold so all I can think is that you were running a very old version.

Anyhow, given it does not seem to work at all in my tests, the lack of any messages, and the poor documentation then I am not going to add any suggestion about it in the README here.

xlucn commented 11 months ago

I got ydotool working with libinput-gestures.

Currently ydotool 1.0.4 have a systemd user service file, which starts the ydotoold executable as the user (no root needed).

As for the configuration, ydotool accepts keycodes, refer to the file /usr/include/linux/input-event-codes.h for that. For example, I have this in my configuration:

gesture swipe left         4 ydotool key 125:1 105:1 105:0 125:0 # super+left

Because keycode for super is 125 and left is 105. :1 is for key-press and :0 is for key-release.

It's definitely harder to configure than xdotool, apparently.