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.

3 comments:

  1. Thanks very much, I managed to get it working on my XPS 13 using your instructions.

    One thing though: Did you get gestures with three fingers to work? Four and five fingers work for me, but I guess three fingers are captured by the synaptics driver and never passed to touchegg.
    ClickFinger3=0 doesn't change anything for me. Synclient shows it has been set to 0, but it still recognizes three-finger taps as middle mouse button.

    ReplyDelete
    Replies
    1. Hi Niko,

      Thanks for the feedback! I'm glad you found this useful. Regarding the 3 finger gestures, yes, they did work for me. You should make sure that there are no actions defined in your touchegg.conf that use other action types. I initially had difficulty getting the forward and back gestures for Firefox working using three finger based left and right swipes and found there were some gestures in the default config that used RESIZE_WINDOW and MOVE_WINDOW with three fingers. Once I removed these entries and left my config with only SEND_KEYS actions, everything worked as expected.

      Delete
    2. The ClickFinger3=0 doesn't work for me neither. So what I end up doing is disable all things relate to buttons and taps as follows:
      TapButton2 = 0
      TapButton3 = 0
      ClickFinger2 = 0
      ClickFinger3 = 0

      I have also needed to create a desktop file in /etc/xdg/autostart to make the TapButton2 & 3 = 0

      Delete