Fusuma
Fusuma is a ruby gem that allows touchpad gestures. It use it with a Apple Magic Trackpad, but other device support may vary. It is installed with:
sudo gem install fusuma
Your user must be in the input group for fusuma to receive gestures from libinput:
sudo usermod -a -G input <username>
I start it with an exec line in my i3 config. Occasionally when the touchpad disconnects I have to kill and restart fusuma to get gestures working again.
Pairing it with xdotool and wmctrl commands gives a lot of options.
Listing 1: ~/.config/fusuma/config.yml##default
swipe:
3:
left:
command: 'xdotool key alt+Right'
right:
command: 'xdotool key alt+Left'
up:
command: 'xdotool key --clearmodifiers ctrl+0'
down:
command: 'xdotool key F5'
4:
left:
command: 'xdotool key super+h'
right:
command: 'xdotool key super+l'
up:
command: 'xdotool key super+k'
down:
command: 'xdotool key super+j'
pinch:
3:
out:
command: 'urxvt'
interval: 4
in:
command: 'rox-filer'
interval: 4
4:
out:
command: 'wmctrl -c :ACTIVE:'
interval: 4
threshold:
swipe: 0.8
pinch: 0.6
interval:
swipe: 1
pinch: 0.5
Wayland
For my wayland setup some things had to change. Mostly xdotool calls got converted to wtype calls. I removed pinch zoom stuff, and application launches.
Listing 2: ~/.config/fusuma/config.yml##o.Linux,h.devil
swipe:
3:
left:
command: 'wtype -M alt -P Right'
right:
command: 'wtype -M alt -P Left'
up:
command: 'wtype -M ctrl -P 0'
down:
command: 'wtype -P F5'
4:
left:
command: 'wtype -M win -P h'
right:
command: 'wtype -M win -P l'
up:
command: 'wtype -M win -P k'
down:
command: 'wtype -M win -P j'
pinch:
4:
out:
command: 'wtype -M win -M shift -P apostrophe'
interval: 4
threshold:
swipe: 0.8
pinch: 0.6
interval:
swipe: 1
pinch: 0.5