Friday, November 13, 2015

Multitouch Gestures with Touchegg in Fedora 23

Just a quick entry for the log book.

Today I installed Fedora 23 on a spare Macbook Pro Retina I had in the office. Man, they have really polished this product. I had heard that Fedora 22 was good but I never tried out it. Fedora 23 just knocks it out of the park, though. Near perfect out of the box experience on the Macbook. The only hardware problem I noticed was that the wifi didn't work out of the box. Not a big surprise, though, since it's a Broadcom chip. Normally the fix is to install akmod-wl from the RPM Fusion repos, however, this package didn't work for me and I had to build it myself, adding an upstream patch. Thankfully, there's a kind soul out there who has created a script to automate this for you.

Now, on to the real reason for this post: Multitouch Gestures!

TL;DR, Touchegg is currently broken in Gnome 3.14 and up. This is because Gnome now has native gesture support (that I still can't figure out how to enable) which interferes with Touchegg's ability to read the gestures. The fix for this is was actually really obvious once I realized this. Make Touchegg start before Gnome! Follow along below to see how to do this:

First we need to download and install touchegg and all it's dependencies. You'll need to use a copr repository. Once you've followd the instructions on that page, create a new file in /etc/X11/xinit/xinitrc.d called touchegg.sh that contains the following lines:
#!/bin/sh
# remove three button mapping from synaptics
synclient ClickFinger3=0
# Launch touchegg
touchegg &
Now just restart gdm with systemctl and everything should be working with the default config.

If you want to customize your config, copy /usr/share/touchegg/touchegg.conf to ~/.config/touchegg/touchegg.conf (you'll need to make that directory inside .config). You can then either edit the file by hand or use the touchegg-gce.

One note before I go. While this does technically "work" it seems that your actions are limited to "SEND_KEYS" only. Something is still interfering with touchegg controlling windows with actions such as "RESIZE_WINDOW" and "MOVE_WINDOW". Thankfully, for my use case anyway, I just wanted to map some of the keyboard shorcuts to snap the windows and switch workspaces to mouse gestures (similar to how they are in Mac OSX).

I hope you found this helpful and if you have any comments or corrections please don't hesitate to leave a comment.