For laptop users, the built-in touchpad can do more magic by enabling multi-touch gestures. And libinput-gestures is a popular solution besides touchegg.
Libinput-gestures is a free open-source utility that reads libinput gestures from your touchpad and maps them to user customized gestures. Each gesture can be configured to activate a keyboard key combination via xdotool
utility.
How to Install libinput-gestures in Ubuntu:
1.) Before getting started, you need to add your user to input
group to have permission to read the touchpad device. To do so, open terminal (Ctrl+Alt+T) and run command:
sudo gpasswd -a $USER input
2.) Libinput-gestures replies on xdotool, libinput-tools, and wmctrl. You need to install them by running command:
sudo apt install wmctrl xdotool libinput-tools
3.) Finally download the source tarball, navigate to source folder, and install it by running following commands one by one:
git clone https://github.com/bulletmark/libinput-gestures.git cd libinput-gestures sudo ./libinput-gestures-setup install
4.) To make the service automatic starts at login, run command:
libinput-gestures-setup autostart start
Because step 1. needs a system restart to apply change, it may outputs failed to add the service to system start. Just ignore it, and restart your machine.
Configure gestures:
The default configurations locates in /etc/libinput-gestures.conf
file. You can open terminal and run command to edit it:
sudo gedit /etc/libinput-gestures.conf
Read the description and change it accordingly.
Hate editing config files? There’s a graphical tool to configure touchpad gestures.
Open terminal and you can run following commands one by one to install the tool via flatpak package:
a.) Install the Flatpak daemon via command:
sudo apt install flatpak
b.) Add the Flathub repository which hosts the app package:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
c.) Finally install the graphical tool via command:
flatpak install flathub com.gitlab.cunidev.Gestures
Once installed, open it from system app launcher and enjoy!
Uninstall Libinput Gestures:
To remove the graphical configuration tool, run command:
flatpak uninstall --delete-data com.gitlab.cunidev.Gestures && flatpak uninstall --unused
To remove the libinput gestures, run command:
sudo libinput-gestures-setup uninstal