Gesture => shortcut or command: feasability on Wayland?

I got a step closer thanks to this post and using the dotool package instead of ydotool in combination with fusuma (touché seems to work as well).

After several tests, here is what worked for me:

  1. Install dotool from AUR

  2. Activate it following the two command indicated in man dotool and test the different commands, such as --listkeys, try in the terminal echo key alt+F4 | dotool to see if it works.

  3. Install rubygems, and fusuma with gem install fusuma
    WARNING: no use of sudo, nor of the fusuma package in AUR!

  4. Add the path to fusuma binary to $PATH in .bashrc, as recommended when installing fusuma.

  5. Add this same path to autostarted apps in settings (ticking the “launch from terminal” option).

  6. Add your custom commands to fusuma’s config file (find it with fd --hidden config.yml), and reboot. For instance:

pinch:
  2:
    in:
      command: 'echo key ctrl+minus | dotool'
    out:
      command: 'echo key ctrl+plus | dotool'
  3:
    in:
      command: 'echo key super+pagedown | dotool'
    out:
      command: 'echo key super+pageup | dotool'
  4:
    in:
      command: 'echo key alt+f4 | dotool'
    out:
      command: "/bin/sleep 1 && /bin/dbus-send --session --print-reply --dest=org.kde.kglobalaccel  /component/org_kde_powerdevil org.kde.kglobalaccel.Component.invokeShortcut string:'Turn Off Screen'"

Alternative with touché:

  1. Install the AUR package touché, customize through the GUI, and use a dotool command if it does not work well in a Wayland session.

  2. activate touchegg service before rebooting:

sudo systemctl enable touchegg.service
sudo systemctl start touchegg

Caveat: touchegg is not supposed to work in a Wayland session, and I notice that it crashes after a few hours.

The only missing part for a full customisability would be to properly override Plasma’s gestures, instead of just clashing with them (both are executed). I guess we need to wait this Plasma feature is implemented.

1 Like