How can I configure Touchegg on Ubuntu 14.04

how can I configure touchegg on ubuntu 14.04 and use the gestures instead of unity gestures I have Dell xps L502x and synaptics trackpad


Solution 1:

I have found a much easier solution: just create a file ".xprofile" in your home folder with the following content:

synclient ClickFinger3=0
synclient TapButton3=0

touchegg &

The first two lines are only needed if you want to use gestures with three fingers. If you leave them out, touchegg will only recongnize gestures with 4 or more fingers.

Alternatively, run the following command that does the same:

echo "synclient ClickFinger3=0
synclient TapButton3=0

touchegg &" > ~/.xprofile

Tochegg will also start on every boot. This worked for me on Ubuntu 15.04 and Ubuntu Gnome 15.04 and should work on any other Ubuntu version.

Solution 2:

You can't override Unity's 3 and 4 fingers gestures just like that. From Touchégg's FAQ

Unity reserves to itself gestures with 3 and 4 gestures making impossible to Touchégg make use of it.

In this post, the author explains how to disable the buid-in gestures modifying Unity's sourcecode. Is written for Ubuntu 12.10 but some comments say that it works on 14.04 too. The relevant part for your question is (copy-pasted)

We obtain Unity sourcecode with the following:

sudo apt-get build-dep unity
cd /tmp
mkdir unity
cd unity
apt-get source unity

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:

void UnityScreen::InitGesturesSupport()
{
  std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);
  wt->GetWindowCompositor().SetGestureBroker(std::move(gesture_broker));
  /*
  gestures_sub_launcher_.reset(new nux::GesturesSubscription);
  gestures_sub_launcher_->SetGestureClasses(nux::DRAG_GESTURE);
  gestures_sub_launcher_->SetNumTouches(4);
  gestures_sub_launcher_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_launcher_->Activate();

  gestures_sub_dash_.reset(new nux::GesturesSubscription);
  gestures_sub_dash_->SetGestureClasses(nux::TAP_GESTURE);
  gestures_sub_dash_->SetNumTouches(4);
  gestures_sub_dash_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_dash_->Activate();

  gestures_sub_windows_.reset(new nux::GesturesSubscription);
  gestures_sub_windows_->SetGestureClasses(nux::TOUCH_GESTURE
                                         | nux::DRAG_GESTURE
                                         | nux::PINCH_GESTURE);
  gestures_sub_windows_->SetNumTouches(3);
  gestures_sub_windows_->SetWindowId(GDK_ROOT_WINDOW());
  gestures_sub_windows_->Activate();
  */
}

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

cd /tmp/unity/unity-*
dpkg-buildpackage -us -uc -nc
cd ..
sudo dpkg -i *deb
sudo apt-get -f install
sudo apt-get autoremove

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:

echo "unity hold"|sudo dpkg --set-selections

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

Another solution would be to get a different desktop.

Solution 3:

I use Ubuntu 14.04 and did not need to make any changes on Unity. I remember last versions of Ubuntu it was a necessary step.

Below a video I did long time ago; however, as I said, I use Ubuntu 14.04 and just installed touchegg following this link (but not doing the Unity change part):

OS X-like multitouch gestures for Macbook Pro running Ubuntu

And my home made video showing that it works fine (even five fingers it is possible). The touchegg config file is in the video description.

Ubuntu 12.10 Multi Gestures (Pt) - Tutorial Link in English

Hope it works.