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.

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!