Multitouch gestures with libinput driver on Linux using fusuma. (GitHub - iberianpig/fusuma: Multitouch gestures with libinput driver on Linux) specifically tested on Garuda KDE Dr460nized & Garuda Sway Editions.
NOTE: For the purpose of this HOWTO I know this setup works on Garuda KDE & Sway Editions. Please see appropriate config.yml for your flavor DE/WM in this post below.
Same Article In Garuda WIki - This Wiki Article WIll Be The Latest & Up-To-Date
My Touchpad : Apple Magic Trackpad 2
NOTE: This should work with any trackpad/touchpad. If you use a different touchpad/trackpad/DE/WM please reply here to this post with your particular device with results and feel free to share your ~/.config/fusuma/config.yml to help others along the way.
Sysinfo:
OS: Garuda Linux
Host: Apple Inc. Mac-B809C3757DA9BB8D
Kernel: 5.17.1-zen1-1-zen
DE: Plasma 5.24.4
WM: KWin
WM Theme: Sweet-Dark
Terminal: konsole
CPU: Intel i7-6700K (8) @ 4.2GHz
GPU: AMD ATI Radeon R9 M395/ M395X Mac Edition
Memory: 3.72GiB / 23.38GiB
Let’s Go.
- 1. Install fusuma and xdotool
paru -S ruby-fusuma xdotool --needed
- 2. Install the following fusuma plugins
paru -S ruby-fusuma-plugin-tap ruby-fusuma-plugin-keypress ruby-fusuma-plugin-wmctrl
NOTE: Do not install the plugin packages “ruby-fusuma-plugin-sendkey” or “ruby-fusuma-plugin-appmatcher” — If you have them installed, remove them. They can cause errors/conflicts with the following config.yml examples provided in this post.
- 3. Create the directory ~/.config/fusuma
mkdir ~/.config/fusuma
-
4. Create a new file ~/.config/fusuma/config.yml using a text editor or touch
-
5. Edit your newly created config.yml to contain the following:
Use a text editor and place the following content (directly below) into the file and save. This particular config works perfectly in Garuda KDE Dr460nized. If you feel Dra460ny, you can look at all the example configs that have been contributed for your convenience HERE and adjust your config.yml to your hearts desire. IIRC this config.yml works on Gnome & XFCE as well. I will eventually test in Gnome and Xfce to confirm.
[ Original Source Used for config.yml Example ] :
KDE to mimic MacOS
- Note: I have made edits to the original [ Source ] (below)
Your ~/.config/fusuma/config.yml should contain the following:
Copy/Paste/Save This Section Into config.yml
swipe:
4:
right:
command: 'xdotool key alt+Right' # History forward
left:
command: 'xdotool key alt+Left' # History back
up:
command: 'xdotool key ctrl+t' # Open new tab
keypress:
LEFTSHIFT:
command: 'xdotool key --clearmodifiers ctrl+shift+t' # Open last closed tab
down:
command: 'xdotool key ctrl+w' # Close tab
3:
left:
workspace: 'next' # Switch to next workspace
keypress:
LEFTSHIFT:
window: 'next' # Move window to next workspace
LEFTMETA:
command: 'xdotool key --clearmodifiers super+ctrl+Left' # Move window to left side
right:
workspace: 'prev' # Switch to previous workspace
keypress:
LEFTSHIFT:
window: 'prev' # Move window to previous workspace
LEFTMETA:
command: 'xdotool key --clearmodifiers super+ctrl+Right' # Move window to right side
up:
command: 'xdotool key Control_L+F10' # Workspace overview
keypress:
LEFTMETA:
window:
maximized: 'toggle' # Toggle Maximize/Unmaximize Window
down:
command: 'xdotool key Control_L+F12' #minimise all windows
keypress:
LEFTMETA:
window: 'close' # Close window
pinch:
2:
in:
command: 'xdotool keydown ctrl click 4 keyup ctrl' # Zoom in
out:
command: 'xdotool keydown ctrl click 5 keyup ctrl' # Zoom out
4:
in:
command: 'xdotool key super+a' # Window overview
out:
command: 'xdotool key super+s' # Workspace overview
plugin:
inputs:
libinput_command_input: # options for lib/plugin/inputs/libinput_command_input
enable-tap: true # click to tap
enable-dwt: true # disable tap while typing
show-keycodes: true # https://github.com/iberianpig/fusuma-plugin-keypress#add-show-keycode-option
- 6. Start fusuma in terminal by simply typing the command fusuma
fusuma
I suggest first to start fusuma in a terminal, not-daemonized, for initial testing. Simply type fusuma
in your terminal as instructed above in step 6. fusuma should now be running in your terminal.
- 7. Test
Try some gestures on your trackpad / touchpad…
You can plainly see which gestures are defined in the ~/.config/fusuma/config.yml that you just created.
Try 3-finger-swipe up/down/left/right, for example.
Watch the terminal output from fusuma in the terminal you started fusuma in to see the output from the gesture as you are swiping, etc.
You should now have Multitouch Gestures.
- 8. Setup fusuma daemonized so it will automatically run when you login
Remember, we are running fusuma in a terminal for testing purposes right now as instructed in this guide. You can ctrl-c out of that to kill it. Now we want to run fusuma in the background each time we login.
8.a: Open KDE Settings/Startup and Shutdown/Autostart
8.b: Click Add / Application
8.c: Type fusuma -d in the popup
fusuma -d
8.d: Click OK
8.e: DONE. Now fusuma will run daemonized each time you login to KDE.
NOTE: I find fusuma to be very reliable as well as cross-desktop.
My short video on Odysee showing ~/.config/fusuma/config.yml and 3-finger swiping in KDE
Another (more complete video) setting up fusuma by another user on Odysee
Enjoy,
-Cannabis