Multitouch Gestures with Linux

April 22, 2014


One of my favorite parts of Linux is the ability to make everything work the way you want. Over the years the only part of OSX i have ever envied was the multitouch gesture support. I have found this replicatable in Linux. This is my guide to getting this working so multitouch can be used by all. In newer systems ( Ubuntu 13.10 and up, Arch, etc.) the version of the xorg input driver shipped no longer supports utilizing gestures using the synclient driver. However, there is a workaround to make this workable. Follow the steps below to install a forked version of the xorg input driver.

NOTE/DISCLAIMER: I would HIGHLY recommend researching and understand what this process is actually doing. You could break your system, so be prepared. I have only tested this on Ubuntu 13.10, 14.04, 14.10, and 15.04, Linux Mint 15 and 16, Elementary Freya Beta 1, and Arch Linux. I used a Thinkpad Edge, Asus Zenbook Prime, and Asus VivoBook to test. I will hopefully test my Macbook Pro Retina sometime in the coming weeks. It has been noted in the comments that this may not work for Kubuntu 15.04.

Install a Working xserver-xorg-input-synaptics Driver

Ubuntu 13.10, Mint 16, and Up

First download the following dependencies

sudo apt-get install build-essential libevdev-dev autoconf automake libmtdev-dev xorg-dev xutils-dev libtool

Now, we need to remove the old driver so the new one will overwrite it

sudo apt-get remove xserver-xorg-input-synaptics

Then, clone the source and build the new driver!

git clone https://github.com/felipejfc/xserver-xorg-input-synaptics.git
cd xserver-xorg-input-synaptics
./autogen.sh
./configure --exec_prefix=/usr
make
sudo make install

When this completes, reboot and make sure your pointer works.

Arch Linux

Installation on Arch is much easier. Simply grab the package from the AUR and reboot!

yaourt xf86-input-synaptics-xswipe-git
sudo reboot

Make sure your pointer works as expected after a reboot

Setting up xSwipe

First install the dependencies.

sudo apt-get install libx11-guitest-perl

Then enable SHMConfig to allow for handling of the gestures.

mkdir /etc/X11/xorg.conf.d/
sudo nano /etc/X11/xorg.conf.d/50-synaptics.conf

Fill the file with the following and save it!

Section "InputClass"
Identifier "evdev touchpad catchall" 
Driver "synaptics" 
MatchDevicePath "/dev/input/event*" 
MatchIsTouchpad "on" 
Option "Protocol" "event"
Option "SHMConfig" "on"
EndSection

Now clone xSwipe to a location of yuor choosing.

 
git clone https://github.com/iberianpig/xSwipe.git

And change the eventkey.cfg file to your liking. EDIT: It seems in both 13.10 and 14.04 versions of Ubuntu (and any version of Cinnamon), the keys set in the "other" category are the ones that are signaled on key swipes. Ignore the ubuntu and gnome sections for unity and cinnnamon.

cd xSwipe/
nano eventkey.cfg

Now test by running:

perl xSwipe.pl

Try to swipe with different gestrues and check the terminal to see if they are working. If they are, you may now add the script to your start up programs depending on your environment. After it is added, reboot and you should have working multitouch gestures!

Update: This seems to take about an hour out of my battery life. To get around this, I change the sensitivity with the parameter -m 30.

perl xSwipe.pl -m 30

Enable Natural Scrolling (Optional)

The last step to take is to fix scrolling broken by the SHMConfig. I prefer natural (reverse) scrolling so this is necessary. This step is not necessary if you prefer traditional scrolling. First, create a file called .Xmodmap in your home directory

cd ~ 
nano .Xmodmap

Fill the file with the following to enable natural scrolling. (Note: In mint, this doesnt work in system apps for some odd reason, but in Arch it works fine)

pointer = 1 2 3 5 4 7 6 8 9 10 11 12

Save the file and restart your session. Your trackpad is now all set up!



comments powered by Disqus
  • Copyright 2013, Matthew Iannucci
  • Site created with web.py, version 0.3
  • Updated January 2015