If you’ve ever used any modern Windows 10 laptop with a decent touchpad, or a MacBook, you know how touchpad gestures make using the laptop so much easier. In many ways, they make the touchpad even better than using a Bluetooth mouse. Unfortunately, Ubuntu hasn’t caught up in that department. But Ubuntu is still Linux so, if you want something, you can have it with a little effort. Today we’ll see how you can customize Ubuntu touchpad gestures.
We’re going to use a nifty little app called Gesture. The interface is designed with the GNOME desktop environment in mind, but the functionality is the same on any desktop. Ubuntu and other Linux distros come with some basic touchpad gestures for scrolling and right-clicking. For anything more, we can use the Gesture app. It deals with gestures that require three or four fingers.
Unlike gestures on macOS or Windows that are set up to do certain things by the OS, you’re free to do whatever you want with your Ubuntu Linux touchpad gestures. For example, you can switch between virtual desktops, see all open windows, snap windows to the edges, etc. by swiping the touchpad. The Gesture app is a front-end for customizing libinput-gestures which is the tool we need. While gestures make using computers easier, you can enhance your efficiency by adding a Windows 10-like taskbar on Ubuntu.
Preparation
libinput-gestures is a command-line utility that adds three and four-finger touchpad gestures to your Ubuntu system. Before we install libinput-gestures on Ubuntu, there are a few things to take care of. First, make sure you have Python 3.6 installed. You can check the installed Python version with the following command.
python3 --version
If the above command returns an error, you might not have Python installed at all. In that case, use the command below to install Python 3.6.
sudo apt-get install python3.6
Next, you’ll need to install git which is necessary to pull things from GitHub. You can do that with the command given below.
sudo apt install git
Once you have Python and git installed, you need to add your user account to the “input” group so that libinput-gestures can read your touchpad. Again, this can be done with a simple command given below.
sudo gpasswd -a $USER input
Once you’ve executed the command, restart your system for the changes to take effect. That’s what you would normally have to do but here’s a short command you can use instead.
su - ${USER}
Next, we need xdotool which allows faking keyboard and mouse input to control windows. That is how our Ubuntu touchpad gestures will work, via faking things. We also need libinput-tools to complete this setup. Both can be installed using the commands given below. Just enter them one by one in a terminal.
sudo apt-get install xdotool wmctrl sudo apt-get install libinput-tools
Don’t Miss: How to Remove Trash Icon from Ubuntu Desktop
Install libinput-gestures on Ubuntu Linux
When you have everything ready, you can now install libinput-gestures. This can be done by just copying and pasting the commands given below. Essentially, we will pull the project from Github, and then install it from the source code since there are no executable packages available.
git clone https://github.com/bulletmark/libinput-gestures.git cd libinput-gestures sudo make install sudo ./libinput-gestures-setup install
Once installed, set libinput-gestures to start automatically with your system, and then start the utility, in that order.
libinput-gestures-setup autostart libinput-gestures-setup start
Must Read: How to Install and Uninstall Apps on Ubuntu using Command
Install Gesture on Ubuntu Linux
As mentioned before, Gesture is a GUI to configure libinput-gestures. So, only install it after you install libinput-gestures on Ubuntu. To install it, again, just enter the commands conveniently given below in the terminal.
sudo apt install python3-setuptools python3-gi libinput-tools python-gobject git clone https://gitlab.com/cunidev/gestures ~/gestures cd ~/gestures sudo python3 setup.py install
To give you an overview, first, we installed the dependencies required, then cloned the git as we did with libinput-gestures, accessed the cloned folder, and installed the app. Once the app is installed, you can open it from the app launcher. The interface is fairly easy to use. You can use the plus button to add a gesture and the pencil button to edit a gesture that’s already been added.
Each gesture mimics a keyboard shortcut. So you can set the gesture to mimic any keyboard shortcut you use more often. You could even set up a three-finger left swipe to copy and three-finger right swipe to paste if you want. All you have to do is make sure you type xdotool key and then the keyboard shortcut in the input field.
Here are a couple of screenshots of my Ubuntu Linux touchpad gestures setup, for your inspiration.
Read Next: How to Take Screenshot on Ubuntu like a Pro