How to Customize Ubuntu Touchpad Gestures

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, Linux-based operating systems such as Ubuntu haven’t really 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, simply 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 do come with some basic touchpad gestures for scrolling and right-click. For anything more, we can use the Gesture app. Basically, 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 makes, 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 simply swiping on the touchpad. The Gesture app is a front-end for customizing libinput-gestures which is the actual 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. It is necessary for the Gestures app to work. 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 will be able to read your touchpad. Again, this can be done with a simple command which is 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 basically 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.

install libinput-gestures on Ubuntu

git clone https://github.com/bulletmark/libinput-gestures.git

cd libinput-gestures

sudo make install

sudo ./libinput-gestures-setup install

Once it is 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 added.

Add touchpad gesture

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

Add comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Tutorials