Oct 25, 2012

OS X-like multitouch gestures for Macbook Pro running Ubuntu


Ubuntu 13.04 Raring Ringtail fits well on my Macbook Pro. Now we can even have a better fan management system for your Macbook.

What I still was missing from OS X is a good set of touchpad gestures. Sure, Unity has builtin support for 2, 3, and 4-fingers drags and tap. However, I don’t like how they are configured. Yet, it is impossible to configure these gestures anywhere.

On the other hand, the Touchégg project is an amazing manager for the gestures. Unfortunately, there are issues with Unity, which has got precedence with its hardcoded gestures.
There is an increasing demand to either configure or disable Unity builtin multitouch gestures.

In this post, I will show how we can disable Unity default multitouch gestures and bring in OS X like touchpad gestures.


There are two prerequisites plus an optional one.

  1. To have a Macbook like keyboard configuration.
  2. To enable the virtual desktops (workspaces) in Ubuntu 13.04
  3. To set the 4 Unity virtual desktops to be all on a single row (4×1) instead of the default (2×2) grid.
  4. Optional: reverse, natural scrolling a la OS X Lion+.

Disable Unity built-in gestures

This section is based on an askubuntu question and two answers to it: one written by user domster and the other one written by myself.

We obtain Unity sourcecode with the following:

To disable its built-in multitouch gestures, we open the file /tmp/unity/unity-*/plugins/unityshell/src/unityshell.cpp with a text editor (e.g., gedit or Sublime Text 2).

After we locate the method UnityScreen::InitGesturesSupport() (line 3381 for Unity 6.10.0, line 3287 for Unity 7.0.0), we comment all the lines starting with gestures_.

This is how it will look like:

We re-build Unity .deb packages and install them in our system.

Optionally, we may want to block upgrades to Unity packages.
In this way, we do not have to repeat the patch steps every time an upgrade is released.
However, we might miss important bug fixes.

What follows blocks updates to Unity:

After a logout and a login, we can see that (among the others) Unity 3-fingers drag gestures has disappeared.

Install Touchégg and enable OS-X like gestures

First, we download Touchégg source code and unpack it. Please note that the following instructions can be obtained in Touchégg documentation.

We install the required dependencies to compile Touchégg.

We compile touchégg and install it. Give the following commands inside touchégg source folder.

The following is a good starting configuration file for touchégg, which should be placed in ~/.config/touchegg/touchegg.conf (create the directories if they do not exist).

With this starting configuration, we change virtual desktop using 3-fingers drags (LEFT and RIGHT); we see the currently active windows using 4-fingers up drags; we invoke the Expo of all the 4 workspaces using 4-fingers down drags.

Feel free to change the config following Touchégg instructions regarding gestures and actions.

We can also employ Touchegg-gce, a graphical program to configure Touchégg.

To automatically start Touchégg when Unity starts, we create the file ~/.config/autostart/touchegg.desktop with the following content.

Another logout and login is required.

What next?

More sophisticated gestures like pinch-to-zoom can be configured on an application basis (e.g., Firefox, Chromium).

However, gestures like PINCH do not work at the moment. We probably have to wait the Ubuntu Mactel team to release xf86-input-multitouch and xserver-xorg-input-synaptics packages for Ubuntu 12.10.
I will update this post if needed.

Featured Image credits: Ideum.com


Douglas Galetti Ribeiro was so kind to post a high-res video on Youtube illustrating what this post enables.
Although it is in Portuguese, the video and his hand gestures are pretty clear. Being Italian, I understand much of it.
Thank you Douglas for taking the time to make the video and to link to this article.

written by dgraziotin

Dr. Daniel Graziotin received his PhD in computer science, software engineering at the Free University of Bozen-Bolzano, Italy. His research interests include human aspects in empirical software engineering with psychological measurements, Web engineering, and open science. He researches, publishes, and reviews for venues in software engineering, human-computer interaction, and psychology. Daniel is the founder of the psychoempirical software engineering discipline and guidelines. He is associate editor at the Journal of Open Research Software, academic editor at the Research Ideas and Outcomes (RIO) journal, and academic editor at the Open Communications in Computer Science journal. He is the local coordinator of the Italian Open science local group for the Open Knowledge Foundation. He is a member of ACM, SIGSOFT, and IEEE.

  • Duncan Perkins Nov 22, 2012 Reply

    I have been searching so freaking long for a solution to this exact problem. thank you for this blog post. You are a god among men.

    • dgraziotin Nov 22, 2012 Reply

      I am glad it helped you!

      • Tom Dec 9, 2015 Reply

        Hey there thanks for the post. I do have an error though that I hope you can help with. After running the ‘dpkg-buildpackage -us -uc -nc’ command it gets to the end of the execution and there are a couple error messages. Failing with error code 2 is what seems to pop up. Any commands after that aren’t working.

        • dgraziotin Dec 12, 2015 Reply

          I’m afraid that I would need to see more information regarding the error that you receive. Also, you might have better luck asking about this in a Ubuntu-related forum. I am currently not running Ubuntu on my Macbook Pro, so I am not really able to test for solutions at the moment.

  • Doug Nov 27, 2012 Reply

    Thank you very much dude! It made my day ! I was looking for something and finally you gave me a good tutorial ! 😀
    Thank You and Thank You !

  • Marcos Vinícius Nov 27, 2012 Reply

    The article only works on Ubuntu 12.10?
    I have a magic trackpad and use Ubuntu 12.04 on my PC.

    • dgraziotin Nov 27, 2012 Reply

      As far as I remember, it works for 12.04 as well.
      You won’t have Unity-6.10.0 but an older version. Additionally, the part in which you modify UnityScreen::InitGesturesSupport() might look different. If you encounter problems, paste the sourcecode somewhere (e.g., pastebin.com) and link it here. I will tell you what to modify. Good luck!

      • Doug May 2, 2013 Reply


        this tutorial also works for 13.04 ! I had just installed it ! 😀

        • Filipe Taveiros May 17, 2013 Reply


          I was so freaking happy when I saw your post saying that it also works for 13.04 raring, but then I saw that it is based on the touchegg project, which is based on the utouch package, which was removed from 13.04 raring. Just when I bought my Apple Magic trackpad. =/

          What did you do to make it work on raring? BTW, I am from Brazil too. =)

  • Michael Demetriou Dec 11, 2012 Reply

    I made a ppa with the proposed changes for quantal, here https://launchpad.net/~qwazix/+archive/unity-without-multitouch

    However I can’t compile touchegg, the linker exits with the following error
    /usr/bin/ld: cannot find -lutouch-geis

    Any ideas?

    • dgraziotin Dec 11, 2012 Reply

      Brilliant! Regarding touchégg, you can find detailed instructions here. Basically, either you do sudo apt-get build-dep touchegg or you install build-essential, libqt4-dev, utouch, libx11-6, libxtst-dev. I would try the first approach.

  • Michael Demetriou Dec 11, 2012 Reply

    I did the first approach correctly but still the same problem. The second approach spits Unable to locate package utouch…

    I think I should contact the touchegg developer. Thanks for the nice tutorial.

    • Azfar Alsukor Apr 25, 2015 Reply

      Hi, can you help me to solve “E: Unable to locate package utouch” error?

  • Nicolai Hansen Dec 19, 2012 Reply

    awesome guide, have been searching long for this, but i ran into a problem. i can’t seem to figure out where touchegg.conf is compared to what you wrote. i created the folder via sudo nautilus but after relog the gestures arent working

    Im new to ubuntu. but i really want my touchpad to work as it did in os x

    • Nicolai Hansen Dec 19, 2012 Reply

      Nevermind i figured it out.
      But you might wanna make it into your guide that you will have to create the file and folder in
      .config/touchegg/touchegg.conf with






      • Nicolai Hansen Dec 19, 2012 Reply

        I have no idea on how to edit posts. but heres a paste bin


        • dgraziotin Dec 19, 2012 Reply

          Nicolai, welcome to Ubuntu and thanks for sharing your settings.
          Maybe somebody will find them more suitable than those I am using.

          I am not sure if I understand your first comment. Are you suggesting me to write where touchegg configuration is supposed to be? In that case, it is written in section Install Touchégg and enable OS-X like gestures (look for “The following is a good starting configuration file for touchégg” in the page text).

          Otherwise, feel free to ask again.

          • Nicolai Hansen Dec 21, 2012

            Yeah. from what i found out while going trough the guide. i got confused when i got to that point. because after i installed touchegg that folder wasent created.

            but i also got confused when i installed touchegg. on how to do it. because your guide says download the source code, but it dosent say where to use the qmake make and sudo make install.

            otherwise awesome guide! first guide actually that worked the first time for me in ubuntu 🙂

  • dgraziotin Dec 21, 2012 Reply

    Thank you Nicolai for you feedback. I’ve just update the post. I hope it clarifies more those two steps.

  • fonnae Jan 7, 2013 Reply

    This is a really great tutorial but unfortunately it didn’t work for me. I’m running 12.10 on an HP Sleekbook.

    One question: I have to use sudo to run this command. Is that correct?
    dpkg-buildpackage -us -uc -nc

    Also, I didn’t shift my workspaces to be on a row of four. Is that necessary?

    • dgraziotin Jan 8, 2013 Reply

      Hello fonnae. More than shifting the workspaces on row of four, you should own a Macbook Pro for this tutorial 🙂 Maybe you skipped the title and the introduction of the article.
      However, this tutorial might work for you when you find whether HP Sleekbook has a multitouch trackpad supported by Ubuntu or not.
      If Ubuntu supports the multitouch “part” of the trackpad, then you should verify whether Touchégg supports your trackpad or not.
      Then, this tutorial might work for you. Unfortunately, I can not test it for you.
      Good luck!

      • Nicolai Hansenu Feb 7, 2013 Reply

        Your guide should work with every multi touchpad pc there is. you guide consist of this

        the keyboard shortcuts are possible to make on every linux distro with the cmd/ctrl swap via Xmodmap

        first part about unity is only for the ubuntu distro where unity is the launcher. ( only reconfigure unity as the guide says, if you run with the desktop enviroment unity)
        if you run with KDE or LXDE or any other desktop environment than unity you dont need to do this part. you can skip directly to the touchegg install part

        the touchpad driver touchegg that you need to make multi gestures, if you follow the guide, it will also work on any linux distro (currently tested by me on xubuntu and kubuntu)

        i just thought this would help, you can add this to the guide if you want 🙂

  • Tech-Mike Jan 21, 2013 Reply

    ok so im on Ubuntu 12.10 x64 , got my apple magic trackpad connected (asus bluetooth dongle bt211)… but tapping with any more than 2 fingers (3+) causes a pause…pointer wont move around for about 10 seconds, single and double finger taps/swipes work. how can i fix this so that i can use gestures/swipes with up to 4-5 fingers ?

  • Duckcarer Mar 20, 2013 Reply

    Firstly, thanks for taking the time to research and write this all up!

    Secondly, I’m running into a problem. I’m trying to do this on 12.04, running Unity 5.18.0
    When I get to the stage of “After we locate the method UnityScreen::InitGesturesSupport() (line 3381 for Unity 6.10.0), we comment all the lines starting with gestures_.”, I can’t seem to find the area where I can input the code.

    Code here: http://pastebin.com/YWeQ9JVV

    • dgraziotin Mar 20, 2013 Reply

      Hello. This post was written for Unity 6.x.x. You are trying to perform the tweak in Unity 5.x.x. As you probably noticed, the two related unityshell.cpp files are completely different in their content.

      When developers bump the major release number by one (5 -> 6), it means that lots of things changed. Unfortunately, I can not try Unity 5 out.

      By looking at the suggestions for Unity 4.x.x, that geis_adapter_.Run(); (line 363) looks suspicious. That would be the line I would comment to start out. I do not see other interesting patterns in the file and I suggest you to try out different combinations.

      Good luck!

  • Cliff Curtis Apr 12, 2013 Reply

    Is this possible on 13.04 (Unity 7)?

    • dgraziotin Apr 13, 2013 Reply

      When Ubuntu 13.04 is out (25th of April), there will be a somehow more stable Unity 7.x. I will study its source code. If a tweak will still be feasible, I will update this post.

    • dgraziotin Apr 29, 2013 Reply

      This post should now be aligned with Ubuntu 13.04 and Unity 7.0.0.

    • Doug May 2, 2013 Reply

      yes man! It works! And works fine!

  • Douglas Galetti Apr 28, 2013 Reply

    Hello dgraziotin,

    It was a surprise to see my video ” review” in your website.
    Your work and ideas transform my Ubuntu in something even better!

    Thank you so much.

  • Doug May 4, 2013 Reply

    What should I do to allow unity to update?
    Which command?

    • dgraziotin May 5, 2013 Reply

  • Tony May 4, 2013 Reply

    Hey there! I have been trying to get this work since yesterday, but I have been having some trouble. So I asked Doug for some help since he is running on a computer that was running windows before. He has been helping me very well, but I just want to get more help:
    1. I tried repacking unity, but once I installed, i was told that nothing changed. As in the nothing got installed, upgraded, or removed. have i not changed unity correctly?
    2. what is the reason in changing the keyboard layout? I checked the config file for touchegg and the keys correspond to the right gestures.
    3. I don’t understand what ~/.config/touchegg means. is .conf a directory? same question for ~/.config/autostart. (in the link he uses config rather than conf)
    4. how do i create a desktop file?

    Sorry for such basic questions. I am trying to learn how linux works, and I don’t have much experience with commands through the terminal. Thank you in advance!

    • Tony May 5, 2013 Reply

      Hello again,

      After doing some research, I answered number three myself. I would still like a response to the rest of the points though.


      • dgraziotin May 5, 2013 Reply


        Let’s see how I can help you.

        1) Does this happen with one of the last two lines,

        If this is the case, don’t worry. I added these last two lines as it once happened to me that some dependencies were missing. These lines would help in such case. Otherwise, they do not harm.

        2) You would change the keyboard layout to have the CMD/CTRL keys of your Macbook pro behave as in OS X. If you do not have an Apple computer, you can safely skip this step

        4) You can create the .desktop file for Touchégg using any text editor. For example, you can create it with

        Hope it helps!

  • Daniel May 5, 2013 Reply

    great tutorial, thank you very much… Works perfect on my notebook’s touchpad, however I also have a touchscreen.
    All the gestures works fine on the screen, except tap-to-click stopped working after disabling unity’s gestures. When I touch the screen, the mouse pointer moves to the location, but it doesn’t initiate mouse click.

    So, I can do all the gestures on the screen, but I can’t use touch screen to click on apps, hyperlinks, …

    I can only use touchscreen to move mouse pointer, but 1 finger tap doesn’t work…

    Is there any way to fix this…??? Any way to disable default unity gestures except tap-to-click…???



  • Doug May 13, 2013 Reply

    For those who watch my video in the extra session (thank you dzraziotin) here is my code:









  • Doug May 26, 2013 Reply

    Guys, I have no idea what happened, but I formated my HD and installed Win8 and Ubuntu 13.04 together yesterday. I installed Touchegg as the tutorial indicated, but I this time I did not change anything in Unity. And… surprise! I was here and I minimized the window… and what?! And I tried the touchegg features (the config file gestures) and it worked !
    No need to things in Unity! Amazing !

  • Josh May 28, 2013 Reply

    I had also have it working without touching unity. I tried the tutorial but kept getting an error during the buildpackage step. so i deleted the source files, installed touchegg from source as directed, created the config file, logged out and in and everything is working! this is with unity 7.0.0 and touchegg 1.1.1

  • dgraziotin May 28, 2013 Reply

    Looks like they are finally working together then, very good!

  • OztracKer May 29, 2013 Reply


    First: thank you for your work !

    I’m trying to get that on my laptop but I have a problem when I try to rebuild unity
    I get an error during the process:
    usr/bin/cmake -E cmake_progress_report “/unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu/CMakeFiles”
    [ 6%] Building CXX object UnityCore/CMakeFiles/unity-core-6.0.dir/MusicPreview.cpp.o
    cd “/unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu/UnityCore” && /usr/bin/c++ -DUSE_X11 -Dunity_core_6_0_EXPORTS -g -O2 -fstack-protector –param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DGNOME_DESKTOP_USE_UNSTABLE_API -std=c++0x -fno-permissive -Werror -Wall -Wcast-align -Wempty-body -Wformat-security -Winit-self -Warray-bounds -fPIC -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/dee-1.0 -I/usr/include/gio-unix-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/Nux-4.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/unity/unity -I/usr/include/gee-1.0 -I”/unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu” -I”/unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu/UnityCore” -include unitycore_pch.hh -Winvalid-pch -o CMakeFiles/unity-core-6.0.dir/MusicPreview.cpp.o -c “/unityRCFG/unity-7.0.0daily13.04.18~13.04/UnityCore/MusicPreview.cpp”
    /unityRCFG/unity-7.0.0daily13.04.18~13.04/UnityCore/MusicPreview.cpp: In member function ‘void unity::dash::MusicPreview::Impl::PlayUri(const string&) const’:
    /unityRCFG/unity-7.0.0daily13.04.18~13.04/UnityCore/MusicPreview.cpp:70:66: erreur: ‘unity_protocol_music_preview_play_uri’ was not declared in this scope
    /unityRCFG/unity-7.0.0daily13.04.18~13.04/UnityCore/MusicPreview.cpp: In member function ‘void unity::dash::MusicPreview::Impl::PauseUri(const string&) const’:
    /unityRCFG/unity-7.0.0daily13.04.18~13.04/UnityCore/MusicPreview.cpp:81:67: erreur: ‘unity_protocol_music_preview_pause_uri’ was not declared in this scope
    make[3]: *** [UnityCore/CMakeFiles/unity-core-6.0.dir/MusicPreview.cpp.o] Erreur 1
    make[3]: quittant le répertoire « /unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu »
    make[2]: *** [UnityCore/CMakeFiles/unity-core-6.0.dir/all] Erreur 2
    make[2]: quittant le répertoire « /unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu »
    make[1]: *** [all] Erreur 2
    make[1]: quittant le répertoire « /unityRCFG/unity-7.0.0daily13.04.18~13.04/obj-x86_64-linux-gnu »
    dh_auto_build: make -j1 returned exit code 2
    make: *** [build] Erreur 2
    dpkg-buildpackage: erreur: debian/rules build a produit une erreur de sortie de type 2

    Can you help me ? 🙂

    • OztracKer May 29, 2013 Reply

      that was when I try compiling in another file than /tmp

      When I try in /tmp, I get this message

      /tmp/unity/unity-7.0.0daily13.04.18~13.04$ sudo dpkg-buildpackage -us -uc -nc
      dpkg-buildpackage: paquet source unity
      dpkg-buildpackage: version source 7.0.0daily13.04.18~13.04-0ubuntu1
      dpkg-buildpackage: source changé par Ubuntu daily release
      dpkg-buildpackage: architecture hôte amd64
      dpkg-source –before-build unity-7.0.0daily13.04.18~13.04
      debian/rules build
      Can’t exec “debian/rules”: Permission non accordée at /usr/bin/dpkg-buildpackage line 510.
      dpkg-buildpackage: erreur: debian/rules build a échoué avec une erreur de sortie de type inconnu -1

      • Nate Haug Aug 2, 2015 Reply

        I also ran into this issue. For me, it turned out that I was running a newer version of GCC (5.x) instead of the default 4.9.2 that came with my version of Ubuntu (15.04). The source of the problem for me was having installed the Toolchain PPA (ppa:ubuntu-toolchain-r/test). To fix it for me, I removed the Toolchain PPA using sudo ppa-purge ppa:ubuntu-toolchain-r/test. That downgraded my GCC back down to the stock version. Then everything compiled fine.

        Thanks for this amazing reference. Those multitouch gestures were driving me *crazy*. I used this tutorial just to get them all disabled to prevent accidentally switching applications or opening Dash randomly. Very appreciated!

    • nimajecryb May 31, 2013 Reply

      If you have the Unity Smart Scopes enabled from the ubuntu-experimental-certified ppa, you’ll need to remove it using: sudo ppa-purge ppa:ubuntu-unity/experimental-certified

      Then run the commands above again and it should build. (If you don’t have this ppa installed, it could be any other ppa that upgraded your Unity past the default 13.04 Unity version)

  • Potentialdiffer Jun 2, 2013 Reply

    Hey folks! First, I want thank you for your great tutorial!

    Mayby you can help me with one problem that occured to me. When I try to “make” the sourcecode it prints an error: No such file or directory: QtGui/QX11Info
    after some research I noticed that I just have a /usr/include/qt4/QtGui/QX11info file but none ../qt5/.. which is needed to build the project. I tried to reinstall the qt5 libs, add some dev-libs I found on the internet and to relink the inlude to qt4… but nothing worked for me. I have Ubuntu 13.04 installed.
    Any of you got any idea? thanks a lot! 🙂

    • nimajecryb Jun 3, 2013 Reply

      You don’t need qt5, it uses qt4. (I assume you’re talking about Touchegg). Also, make sure you run sudo apt-get build-dep touchegg or install the appropriate libs.

      • Potentialdiffer Jun 3, 2013 Reply

        Thanks for your quick response!
        If I need qt4 then I dont know why I get these problemes. The libs are all installed, sudo apt-get build-dep touchegg returns no new installations.
        I tried changing the code a bit. In the Include.h file I changed the #include to #include . Now the problem disappeared but I got another one. The Compiler says:

        “../src/touchegg/gestures/collector/GestureCollector.cpp:90: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]”

        However, solving these codeparts cant be part of my solution as the code works for you…
        Must be another problem, but I dont have any idea… maybe you are smarter 😉 thaanks!!

  • nimajecryb Jun 3, 2013 Reply

    If you can’t get it to build, simply install the version from the repository: sudo apt-get install touchegg . They are the same version (1.1.1)

    • dgraziotin Jun 3, 2013 Reply

      Thanks for replying to some comments. This is what I am looking for, in the Open-Source community: spontaneous collaboration.

  • Ro Jun 5, 2013 Reply

    hey folks 🙂 first of all thanks for the great tutorial 🙂 did someone try this on gnome shell 3.8 cause i cant get it to work 🙂 touchegg doesnt detect anything.

  • bobbins Jun 5, 2013 Reply


  • eBait Jul 10, 2013 Reply

    Hi there, thanks for this tutorial 🙂
    It works great, I just have one question. How can we make Touchegg a persistant “daemon” that does not get killed when suspending Ubuntu? This would finish off my 13.04 install on the Zenbook 🙂

    • dgraziotin Jul 11, 2013 Reply

      This never happened to me. How did you install Touchégg? Does this happen with the repository version?

  • Nick Jul 22, 2013 Reply

    I tried your method but it did not worked :s
    I followed every step.
    When i enter $touchegg on a terminal, I get this:

    Reading config from “/home/nick/.config/touchegg/touchegg.conf”
    Try to make a multitouch gesture. If everything goes well the information about the gesture must appear
    [+] Avaliable gesture:
    Name -> Flick
    [+] Avaliable gesture:
    Name -> Drag
    [+] Avaliable gesture:
    Name -> Pinch
    [+] Avaliable gesture:
    Name -> Rotate
    [+] Avaliable gesture:
    Name -> Tap
    [+] Avaliable gesture:
    Name -> Touch

    And nothing is working.. I still have 2 fingers scrolling, but that’s all.
    The problem is coming from HW? Which test can I perform to help you?

    Thanks for your support!

    • dgraziotin Jul 23, 2013 Reply

      Hi Nick. Unfortunately,I do not own a Macbook anymore, and I cannot verify the steps. Assuming you have Ubuntu 13.04 installed, please try first to use the original unity and install Touchégg from the repository. Some users reported that it worked out-of-the-box for them.

      • Nick Jul 25, 2013 Reply

        Thanks for your quick reply 🙂
        Yes I have Ubuntu 13.04. I’ll try to use the original Unity as you said.

  • Eric Aug 9, 2013 Reply

    Awesome Post. I was able to get it to work using the Apple Magic Trackpad on an HP Laptop on 13.04. The only thing I can’t get to work is using TouchEgg for 2 Finger inputs But the 3, 4, and 5 are so awesome! So much fun! Any ideas on how to turn off the 2 Finger in Ubuntu, so TouchEgg can take over?

    I also ordered a Logitech T651 Touchpad that I’ll be getting tomorrow, so I’m really hoping it works as well since I’m just borrowing the Apple Trackpad

    • Andrey Dec 11, 2013 Reply

      Did you have loky with Logitech T651 Touchpad on ubuntu? i got one and could not paired with ubuntu by bluetoth.

  • Alekhios Aug 15, 2013 Reply

    Can this work on elementary OS Luna??

    • dgraziotin Aug 15, 2013 Reply

      I think that Elementary OS does not have Unity. You should probably only need to install and configure touchégg

    • Andrei Dec 31, 2013 Reply


      I can confirm that it does work for Elementary OS with my built-in Dell XPS13 trackpad. However, I’m having a little bit of problem with touchegg to recognize my just bought Logitech T615.

      I’ll report later if I do manage to make it work.

      BTW, thank you @dgraziotin for the great tutorial.

      • Andrei Dec 31, 2013 Reply

        Can’t edit previous post..

        I meant Logitech T651 and I ended up returning it and got an Apple Magic Trackpad instead. Works wonderful.

  • Khushal Shah Sep 8, 2013 Reply


    Thank you for the awesome tutorial. I was able to run it properly except for one glitch. When I logout and login back I can’t use the 4 finger drag down properly. It works a few times and just stops. Any suggestions?

    • dgraziotin Sep 10, 2013 Reply

      Is touchégg running when you logout and login back?

      • Khushal Shah Sep 13, 2013 Reply

        Yes it is running when I log out and log back in. When it opens up the 4 finger drag down works 3/4 times and then stops. Is there any solution? . This is out of topic a bit but I have a few more questions.
        1.Does the sleep/suspend feature of ubuntu work on Mac?
        2. My laptop heats up while running ubuntu? Any workarounds?

  • pepper_chico Sep 17, 2013 Reply

    Hi, i’d like to say thank, the tutorial worked great, I’d just like to update you on some things that may improve it:

    1) I’m on 13.04 and I didn’t need to compile touchegg, it’s was a matter of installing it from software center.

    2) pinch is working pretty good, I’m using if for Super+w without problems.

    In the end, I like much more my Ubuntu environment than my OS X, I’m running on an macbook pro early 2011 13″. I like to have multiple workspaces and I use a 5×2 workspace grid, hence, I’ve setup gestures differently than usual OS X like, I have horizontal and vertical 3-finger drag for switching between workspaces, and 5-finger pinch to show windows inside a workspace.

  • pepper_chico Sep 17, 2013 Reply

    Also, I didn’t disabled 2-finger gesture from unity handling, I let it handle it for vertical and horizontal scrolling. So I left touchegg with 3, 4 and 5-finger gestures.

  • Eoin Sep 27, 2013 Reply

    I’m new to Linux…

    I’m stuck and can’t find the touchegg source folder to run the install command… how do I navigate there? WHERE do I navigate to? cd / <–?

    Thanks in advance 🙂

    • dgraziotin Sep 30, 2013 Reply

      Hi there! First of all, which version of Ubuntu are you using?
      If a recent one (e.g., 13.04), you can avoid installing Touchégg from the source files. Instead you could simply do a sudo apt-get install touchegg.
      Otherwise, the source file should be in your ~/Downloads folder.

      • Eoin Oct 11, 2013 Reply

        Thanks for the reply!

        First of all, I did get it working before, but I’ve deleted that version of Ubuntu and I’m starting over on 12.10 and I can’t fr the life of me get it working…

        I managed to disable the native gestures.
        I’ve created the autostart file and the conif file, just as you said in your guide.

        This is driving me nuts! lol… Any further guidance would be greatly appreciated

  • Pooya Oct 24, 2013 Reply

    Thank you for writing this down but when I write
    sudo make install

    gives me this:
    install -m 755 -p “touchegg” “/usr/bin/touchegg”
    strip “/usr/bin/touchegg”
    install -m 644 -p /home/pooya/Downloads/touchegg-1.1.1/installation/touchegg.conf /usr/share/touchegg/

    Never seen this result. What is it?

    • dgraziotin Oct 25, 2013 Reply

      Hi, these are quite standard (although verbose) installation messages. They are actually reporting where the files are moved, and what permissions they are set to. Your installation was successful.

      • Pooya Oct 25, 2013 Reply

        Thank you 🙂 I installed Touchegg-gce too and I’ve got my /usr/bin/touchegg which means it’s installed. I haven’t disabled unity gestures yet and none of the gestures works(3 or 4 fingers, I logged out and in). Do I have to disable unity to make this work or something else is wrong with my installation?
        Thanks in advanced

      • Pooya Oct 25, 2013 Reply

        oh by the way I just installed 13.10 a few days ago(no update) and seems like touchegg should work on 13.10 too.

  • Dave Oct 29, 2013 Reply

    Great tutorial. I’ve gotten hung up on rebuilding Unity.
    I get “dpkg-buildpackage: error: debian/rules build gave error exit status 2”
    How can I remedy this?


    • Dave Oct 29, 2013 Reply

      I’m on 13.10

  • Andreas Nov 3, 2013 Reply

    Shouldn’t the touchegg.conf actually be named xorg.conf and exsist inside /etc/X11/? This seems to be the case for me.

    • dgraziotin Nov 3, 2013 Reply

      Nope. xorg.conf is for configuring..well, X.
      this is an example of xorg.conf. As you see, it looks completely different from touchegg.conf. Additionally, modern Ubuntu distributions do not even have an xorg.conf file.

  • Dominik Dec 7, 2013 Reply

    So does it work for the current version (13.10) ? Working example anyone? It would be great to know before digging into details.

  • sonny Dec 22, 2013 Reply

    I’m using 13.10 on a lenovo yoga 2 pro, not sure if that matters.

    When i try this command:

    sudo dpkg -i *deb

    i get this error:

    sonny@ssonny-Y2Pro:/tmp/unity$ sudo dpkg -i *deb
    dpkg: error processing *deb (–install):
    cannot access archive: No such file or directory
    Errors were encountered while processing:

    any ideas?

    • dgraziotin Jan 7, 2014 Reply

      You are not giving the command within the directory that contains the .deb files.

      • Duftpukie Apr 1, 2014 Reply


        i have the same problem. How can i find the .deb files?

  • Dan Seddon Jan 5, 2014 Reply


    • Dan Seddon Jan 5, 2014 Reply

      Sorry, for the miss-send…

      Thanks for your great guide! I’ve used it before successfully. Rd

      Xlib: extension “GLX” missing on display “:22907”.
      Nux: [GraphicsDisplay::CreateOpenGLWindow] GLX is not supported.
      Segmentation fault (core dumped)

      I’m pretty sure I have GLX, I’m running on macpro retina with the nvidia drivers. I can run 3D apps and glxgears with no issues… I’m a bit puzzled what to do next 🙁

      • Dan Seddon Jan 5, 2014 Reply

        “Rd” – should be “Right now I get this error when recompiling unity.”

      • dgraziotin Jan 7, 2014 Reply

        Hi. Which Ubuntu distribution are you using? Please note that I have never tried it after Ubuntu 13.04, and that I do not own a Macbook anymore. It is quite difficult for me to help!

        • Dan Seddon Jan 11, 2014 Reply

          Thanks for getting back to me. This is 13.10, so I guess it’s a version you’ve not tried. Perhaps the compile issue is best sent to the ubuntu forum.

          Thanks again for you guide.

  • jacob Mar 13, 2014 Reply

    Thanks for this great tutorial :). i made this work on 12.10. but could not make it work on 13.10.

    Does anyone have any idea if this will work on 14.04?

    • James Apr 18, 2014 Reply

      See my comment below v v v v

  • James Apr 18, 2014 Reply

    Working on Ubuntu 14.04 … there was an issue where something called autopilot (https://wiki.ubuntu.com/Unity/QA/Autopilot) couldn’t be configured? But in true n00b spirit I tried carrying on anyway and everything works 🙂

    • Campbell Vertesi Apr 27, 2014 Reply

      Really? I couldn’t get this going on Saucy OR Trusty. I had no problem recompiling per this article; everything seemed just fine… but touchegg never picked up any of my mouse movements.

      From my reading of the googles, touchegg depends on utouch, which no longer exists in 13.x and 14.x . A lot of earlier guides are based on using the synaptics driver, but (at least for me) Ubuntu preferred to install mtrack.

      What version of macbook pro do you have? I’m on a 9,2 .

  • khampasith chanthavong Jun 3, 2014 Reply

    working for me Ubuntu 14.04 LTS 64-bit
    Thank you

  • doubleavocado Jul 10, 2014 Reply

    Worked almost flawlessly on Ubuntu 13.10 on an Asus Zenbook Prime UX31A. Only hiccup was that I got an error when running “sudo dpkg -i *deb” that said something about not being able to configure unity-autopilot or something like that because certain things it depended on were not installed. It processed a variety of other commands just fine, and after all was said and done and I followed the rest of the instructions (except I just installed touchegg using apt-get instead of compiling the source), the gestures work perfectly! Thank you for this guide.

    Anyone know if that unity-autopilot thing will be an issue? I know I’m not remembering the name correctly. Unfortuantely I failed to copy the text.

    • dgraziotin Jul 11, 2014 Reply

      Actually, there is a package called unity-autopilot in the list of packages called unity-something. It seems that it is a collection of tests for the development of Unity. No harm for you!

  • Maulican Feb 2, 2015 Reply

    (using google translator)

    I use Ubuntu 14.04 64bits

    I’m trying to remove the gestures in unity with these instructions. All goes well until the command dpkg-buildpackage -us -uc -nc

    then shows me an error:


    You could help me discover that I’m missing? thanks

  • Trevor Feb 25, 2015 Reply

    I just followed this post with ubuntu 14.10 unity and a mid-2012 11″ macbook air (Model A1465).
    It has worked perfectly so far, really without any problems! Thank you so much for the well written guide!

  • Fabricio Aug 7, 2015 Reply

    Hello. I’m wondering if this still works on Ubuntu 15.04, or if there is any other way of doing it with less terminal steps. Thanks in advance!

  • Alkshendra Sep 10, 2015 Reply

    Not working on Dell inspiron 5548.

    On saving the .conf file i am seeing this message:

    alkshendra@alkshendra:~$ gedit .config/touchegg/touchegg.conf

    (gedit:10313): Gtk-WARNING **: GtkScrolledWindow 0x12b6880 is mapped but visible child GtkScrollbar 0x12c0a50 is not mapped

    (gedit:10313): Gtk-WARNING **: GtkScrolledWindow 0x12b6880 is mapped but visible child GtkScrollbar 0x12c0c50 is not mapped

    (gedit:10313): Gtk-WARNING **: GtkScrolledWindow 0x12b6880 is mapped but visible child GtkScrollbar 0x12c0a50 is not mapped

    (gedit:10313): Gtk-WARNING **: GtkScrolledWindow 0x12b6880 is mapped but visible child GtkScrollbar 0x12c0c50 is not mapped

    And on running touchegg it says:

    alkshendra@alkshendra:~$ touchegg
    Reading config from “/home/alkshendra/.config/touchegg/touchegg.conf”
    Try to make a multitouch gesture. If everything goes well the information about the gesture must appear
    [+] Avaliable gesture:
    Name -> Flick
    [+] Avaliable gesture:
    Name -> Drag
    [+] Avaliable gesture:
    Name -> Pinch
    [+] Avaliable gesture:
    Name -> Rotate
    [+] Avaliable gesture:
    Name -> Tap
    [+] Avaliable gesture:
    Name -> Touch

    Please help.

    • dgraziotin Sep 10, 2015 Reply

      The messages you see are not really errors.

      The first set of messages you pasted here are some warnings (hence the -WARNING part) of the graphical libraries employed to build your editor (gedit). They are common and usually not dangerous. You will likely see them each time you open the editor from the command line. So far, so good.

      The second set of messages are by touchegg. They are telling you that it is reading the config file that you saved previously. It is also telling you that the gestures flick, drag, pinch, rotate, tap, and touch are available.

      So, from the messages, everything appears to be working fine. However, neither I or the people commenting here can confirm that the Unity part works for Ubuntu 15.04. The tutorial was written for 13.04. I am currently not using Ubuntu so I cannot really test this for 15.04.

  • andy chong Nov 9, 2015 Reply

    Hi, I’m use Ubuntu 14.04 64bits

    I follow the intructions given here. It goes well until the command dpkg-buildpackage -us -uc -nc

    Here’s the code:

  • Cruz Jun 21, 2016 Reply

    I’ve NOT followed all the steps on this tutorial with Ubuntu 16.04 and I’m using the touchegg, just downloaded with apt. The commands I’ve made:

    sudo apt install touchegg
    echo touchegg & > $HOME/.xprofile

    restarted my session and with Unity it works awesome!!!

    My machine is a Dell XPS 15 9550 with touch-screen

  • Cruz Jun 21, 2016 Reply

    Sorry for double posting, I’ve entered the wrong second command:

    echo ‘touchegg &’ >> $HOME/.xprofile

  • Edoardo Jul 16, 2016 Reply

    i would like to point out that if you experience a very fast dragging speed after installing touchegg (i set my trackpad for 3 finger drag&drop) it can be fixed by
    sudo apt-get install gpointing-device-settings
    and then changing the trackpad speed that will rever it to a more sensible one

Leave a comment