Most Windows and Mac computers support multi-touch gesture. For example, swiping up with three fingers will show you the desktop while swiping down the same way will reveal all the open Applications. Unfortunately, most Linux distros including Ubuntu, don’t support multi-touch gestures right out of the box. Although, two-finger scroll and double-tap works, it lacks the three-finger and four-finger gestures.
Scrolling through a bunch of GitHub repositories led me to libinput-gestures which worked perfectly on my Acer E5-575G laptop. I also found a couple of GUI based gestures app on the Ubuntu Software repository. So let’s see how you install and configure multi-touch gestures on Ubuntu.
Get Multi-Touch Gestures on Ubuntu 18.04
There are multiple multi-touch gesture apps present on GitHub and Ubuntu Software Center. Out of all those, these 2 apps worked flawlessly for me.
1. Extended Gestures
Ubuntu right-out-of the box supports scrolling gestures and double taps. With Extended gestures, you can extend that list to 3-finger and 4-finger swipe. You can download Extended Gestures from the Ubuntu Software Center. Once you have the app installed, launch it and you will be presented with the additional gestures it provides.
The app also lets you modify the swipe sensitivity. In my case, I have kept it to “1”. Since 0 sensitivity would require me to move my fingers through the entire trackpad.
Download Extended Gestures
libinput-gestures is a command-line utility for adding multi-touch gestures on your Ubuntu machine. It functions the same as Extended Gestures but offers far more gestures and granular controls. Before we begin with the installation, we need git and Python 3.0+ as the pre-requisites. Luckily, Ubuntu already comes installed with Python. But we need to make sure the version is 3.0+. So, to check your Python version use the following command.
In case the command gives an error, you don’t have python 3.0 installed. To install that, run the following command.
sudo apt-get install python3.6
After you have python and git installed, we can proceed towards installing libinput-gestures. However, libinput-gestures need to read your touchpad device and for that, your user account to be part of the “input” user group. Run the following command to add yourself to the input user group. You can manually replace it with some other id if you want to add libinput-gesture
sudo gpasswd -a $USER input
Here, $USER is an environment variable whose value is your user id. After the command has completed successfully, restart your system for the changes to take effect.
After the restart, we need to install wmctrl and libinput-tools. wmctrl allows a program to interact with a window which is required by libinput-gestures to minimize windows and applications. To install both of them, run the following commands.
sudo apt-get install xdotool wmctrl sudo apt-get install libinput-tools
After the successful installation of libinput-tools and wmctrl, we can finally proceed to install libinput-gestures. Run the following commands to install the utility.
git clone https://github.com/bulletmark/libinput-gestures.git sudo make install sudo ./libinput-gestures-setup install
The git clone command will copy all the files from GitHub and place it under your home directory. Next command installs libinput-gestures from the downloaded directory.
After we have the files in place, we need to start the libinput-gestures application plus configure it to autostart every time. For that, use the following commands in respective order.
libinput-gestures-setup autostart libinput-gestures-setup start
Once done, the libinput-gesture will map the three-finger swipe up gesture to go to Desktop and the three-finger swipe down on the desktop to go to the previous app. You can also pinch in and out to reach the app overview menu.
Make sure you perform the pinch-in and pinch-out at the center of the trackpad to get accurate results.
You get few default gestures with the app like the three-finger swipe and pinch-to-zoom. You can also modify or add other gestures like swipe right_up, swipe left_up, etc. To do that, we need to modify the libinput-gestures.conf file. So, run the following command
This command will open the configuration file wherein you can add or modify gesture actions. For example, I have mapped the Ctrl+Tab shortcut to the left-swipe-up gesture. This lets me quickly switch tabs in chrome with just a left-swipe-up on the trackpad.
These gesture apps primarily map keyboard shortcut to a trackpad action. It won’t be as fluid as on macOS or Windows but nonetheless is a good workaround. For more Ubuntu articles, check out our articles on best PDF editor for Ubuntu and best open-source network monitoring tools for Linux.
For any issues or queries, let me know in the comments below.