taj-ny / kwin-gestures

Custom touchpad gestures for KDE Plasma 6
GNU General Public License v3.0
9 stars 0 forks source link

A way to debug the plugin #5

Closed Damglador closed 2 hours ago

Damglador commented 2 hours ago

I want to add gestures for:

3 finger

I have no clue what I'm doing, guide is not the clearest and lack of logs makes it worse, because examples dont work and I cant even know why.

I did:

git clone https://github.com/taj-ny/kwin-gestures
cd kwin-gestures
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install

[Gestures][Touchpad][Firefox Back][Swipe] Direction=Left ThresholdX=10

[Gestures][Touchpad][Firefox Back][Actions][0] Type=KeySequence

[Gestures][Touchpad][Firefox Back][Actions][0][KeySequence] Sequence=press LEFTCTRL,press LEFTBRACE,release LEFTCTRL,release LEFTBRACE

- Enabled the plugin in Desktop Effects
- Tabbed to Firefox and tried the gesture
- Nothing happend

I've tried creating a config for volume up gesture:

[Gestures][Touchpad][Volume Up] Type=Swipe Fingers=3 TriggerWhenThresholdReached=true [Gestures][Touchpad][Volume Up][Swipe] Direction=Up Threshold=0.5 [Gestures][Touchpad][Volume Up][Actions][0] Type=Command [Gestures][Touchpad][Volume Up][Actions][0][Command] Command="pactl set-sink-volume @DEFAULT_SINK@ +5%"


And I don't know how to know what's wrong

Distro: Arch Linux
Plasma version: 6.2
taj-ny commented 2 hours ago

Are you on Wayland or X11?

Try running qdbus org.kde.KWin /Effects org.kde.kwin.Effects.reconfigureEffect kwin_gestures and try again. If that doesn't work, run libinput debug-events as root and check if the gesture is being recognized properly. You should see something like this:

event13  GESTURE_SWIPE_BEGIN     +16609.816s   3
event13  GESTURE_SWIPE_UPDATE    +16609.816s   3  0.16/-8.03 ( 0.18/-8.76 unaccelerated)
...
event13  GESTURE_SWIPE_END       +16609.989s   3

The 3 is the amount of fingers.

There are a couple of issues with the volume up gesture:

The last issue is what's preventing the gesture from working.

Damglador commented 2 hours ago

Are you on Wayland or X11?

Yes

The last issue is what's preventing the gesture from working.

Yes, removing them fixed it.

Thank you. I got everything to work: kwingesturesrc.txt

You may include in examples, perhaps other ppl will use it.

Also, is there a way to repeat an action? Something like TriggerWhenThresholdReached=true and Repeat=50 so it repeats every 50ms instead of on release. Would be handy to control audio volume.

taj-ny commented 2 hours ago

Also, is there a way to repeat an action? Something like TriggerWhenThresholdReached=true and Repeat=50 so it repeats every 50ms instead of on release. Would be handy to control audio volume.

Not yet, I'll add it.

Also, I just figured out why the Firefox gesture didn't work, it's because of keyboard layouts.

Damglador commented 2 hours ago

Not yet, I'll add it.

Nice, thanks

Also, I just figured out why the Firefox gesture didn't work, it's because of keyboard layouts.

Well, I got unlucky with choice for test action and that gaslighted me to think that nothing works.

Damglador commented 1 hour ago

Libinput also has a weird quirk, it has a pretty long delay before it registers "hold". As I understand, even with delay 1ms in config, it will trigger only after 10ms minimum. And that happens only with 3+ fingers. Bearable.