71

I was talking to a friend who owns a Mac. He has his set up so that when he swipes three fingers across his touchpad, it moves to the workspace in that direction. Is it possible to set this up in Ubuntu?

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
superbriggs
  • 1,307
  • 2
  • 11
  • 14
  • 1
    I can't personally vouch for whether this method works, but there is a program called EasyStroke that may do what you're looking for. See here for setup instructions. – JamesG Mar 29 '12 at 10:29
  • https://github.com/arunhedcet/mac-gestures – tkay Jan 18 '16 at 14:05

7 Answers7

30

How to change workspaces using touchpad gestures in ubuntu

Complete tutorial using touchegg, easystroke is better to be used with mouse rather than touchpad.

In case you are using unity you may experience some conflicts with build-in gestures. The tutorial I gained information from deals with this issue (please see the link below). I didn't have any build in gestures, so this how-to provides only information how to set up things.

  1. Download Touchegg:

    sudo apt install touchegg
    
  2. run it, but kill just after that, it will create a file

    ~/.config/touchegg/touchegg.conf
    
  3. open it in an editor you desire and add those three lines below into the name="All" section

    <gesture type="DRAG" fingers="3" direction="RIGHT">
       <action type="SEND_KEYS">Control+Alt+Left</action>
    </gesture>
    <gesture type="DRAG" fingers="3" direction="LEFT">
       <action type="SEND_KEYS">Control+Alt+Right</action>
    </gesture>
    
  4. Run touchegg to try it out

    touchegg &
    
  5. Edit the config file as you wish and then add touchegg to the list of startup applications

The tutorial I mentioned can be found here - there some things out of date (you don't have to compile it). Anyway thx to the creator!

Pablo Bianchi
  • 15,657
tsusanka
  • 556
  • Gestures are not recognized on my computer :( – Jonah Jan 16 '14 at 03:34
  • 2
    This is not working on Ubuntu 15.04 – Lucio Oct 01 '15 at 00:17
  • 4
    Yeah, not working on my XPS13 either, running 15.04, or (today) 16.04 nightly. I wonder if there's a useful way to trouble shoot it, since the O/S does recognise 3-finger taps (mostly), but touchegg isn't interested. – Scaine Feb 24 '16 at 18:56
  • It's working fine :D with elementary OS – Akbarsha Apr 28 '16 at 10:58
  • 3
    is there a solution for Ubuntu 16.04?? – Ivan Aracki Aug 31 '16 at 12:19
  • worked like a charm for me on ubuntu 16.04 – Fabio Jul 21 '18 at 05:22
  • 1
    Not working on my case, Ubuntu 16.04 is detecting two fingers scroll but not multitouch like 3 fingers. Need to install something more? – Gerard Cuadras Aug 09 '18 at 13:06
  • I've got 4 workspaces arranged in a 2x2 grid: How can I reconfigure the 3-finger (or 4-finger) swipe on my Thinkpad touchpad to switch between these four (rather than only left <-> right with the 3-fingers) ?

    Edit: just figured out I can use the 3-finger left <-> right "repeatedly" and browse all four workspaces, albeit not in a 2x2, but rather a 1x4 "grid". How to make it 2x2, with left <-> right and up <-> down ?

    – nutty about natty Jul 11 '23 at 10:21
26

Comfortable Swipe

Try comfortable-swipe. Provides 3-finger and 4-finger gestures for switching workspaces, plus a couple more like the window spread in mac.

This also uses xdotool, but more comfy than the laggy libinput-gestures if you ask me.

Rico
  • 371
  • 3
  • 5
  • 3
    works with Ubuntu 18.04 LTS – Nitsan Baleli May 06 '18 at 19:26
  • Works smoothly with Kubuntu 18.04 LTS – subtleseeker Oct 16 '18 at 07:47
  • 2
    For Ubuntu 18.10 you have to replace "libinput-debug-events" in src/comfortable-swipe.cpp with "libinput debug-events" three times. Than install with " bash install" –  Oct 21 '18 at 22:27
  • It works on my 18.04 but takes several seconds to respond and my fans go crazy fast and noisy making it not worth it. Nothing special appears on htop during this time. – wranvaud Feb 16 '19 at 10:14
  • Worked in 5 min, nothing else worked after hours. Brilliant, thanks for sharing ! – maxime1992 Mar 09 '19 at 23:10
  • Works on my Dell G5 with 18.04, make sure to run the permissions setting it shows in the README and log in+out. Up and down swipes work perfectly! – Jordan Mackie Dec 08 '19 at 16:09
  • Worked like a charm on Ubuntu 20.04. Just note that, in the instructions given on the project's Github, it says to logout and then log back in. That doesn't work - you gotta restart your computer. – John Red Oct 30 '20 at 20:18
  • 1
    Works perfectly well on XPS 9500 15" with Ubuntu 20.10 (Gnome). Didn't need to restart, just log out and in again. – nealio82 Dec 09 '20 at 10:51
16

Your touchpad (hardware) needs to support this feature and you then may need to configure your touchpad (Ubuntu automatically recognizes and enables some hardware).

One common drier is synaptic. You can enable two finger scrolling from the mouse and touchpad section in the control panel.

control panel

If you wish additional options you will need to manually edit a few configuration files and the options are hardware dependent.

There is a debugging page here:

https://wiki.ubuntu.com/DebuggingTouchpadDetection

Take a look at that page, if you can identify your hardware we can perhaps give you more specific assistance.

An example of hardware specific guides: https://wiki.ubuntu.com/Multitouch/AppleMagicTrackpad

Consider easystroke

You can also take a look at "easystroke"

http://sourceforge.net/apps/trac/easystroke/wiki

Here is a demo of easystroke in action: http://www.youtube.com/watch?v=CagAEgXAAzA

Panther
  • 102,067
12

The following worked for me on Ubuntu 16.04 and a 2017 Dell XPS 13 (9360):

sudo gpasswd -a $USER input
sudo apt-get install xdotool wmctrl libinput-tools
git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo ./libinput-gestures-setup install

Restart your computer after the above steps. My ~/.config/libinput-gestures.conf is:

gesture swipe down  xdotool key ctrl+alt+Up
gesture swipe up    xdotool key ctrl+alt+Down
gesture swipe right xdotool key ctrl+alt+Left
gesture swipe left  xdotool key ctrl+alt+Right
1

This was my solution: 4 fingers and natural direction.

 <gesture type="DRAG" fingers="4" direction="RIGHT">
       <action type="SEND_KEYS">Control+Alt+Right</action>
    </gesture>
    <gesture type="DRAG" fingers="4" direction="LEFT">
       <action type="SEND_KEYS">Control+Alt+Left</action>
    </gesture>
Enrico
  • 11
1

I used the synaptics driver with xdotool to do that...

For speed of my macbook touchpad:

sudo nano /usr/share/X11/xorg.conf.d/70-synaptics.conf
# Touchpad Speedup
        Option "AccelFactor" "0.025"
        Option "MinSpeed" "0.80"
        Option "MaxSpeed" "0.95"
        Option "FingerHigh" "55"
        Option "FingerLow" "45"

For 3 fingers gesture change workspace:

sudo nano ~/.config/libinput-gestures.conf
gesture swipe up        3       xdotool key ctrl+alt+Up
gesture swipe down      3       xdotool key ctrl+alt+Down
gesture swipe left      3       xdotool key ctrl+alt+Left
gesture swipe right     3       xdotool key ctrl+alt+Right
Calvin
  • 11
  • 1
0

Like already mentioned:

sudo gpasswd -a $USER input
sudo apt-get install xdotool wmctrl libinput-tools
git clone http://github.com/bulletmark/libinput-gestures
cd libinput-gestures
sudo ./libinput-gestures-setup install

But you have to go to:

cd ~/libinput-gestures

and edit the created libinput-gestures.conf:

gedit libinput-gestures.conf

And then make safe the following is set correctly:

gesture swipe down  xdotool key ctrl+alt+Up
gesture swipe up    xdotool key ctrl+alt+Down
gesture swipe right xdotool key ctrl+alt+Left
gesture swipe left  xdotool key ctrl+alt+Right

Remember: You have to set the key combinations in the Ubuntu settings to the ones shown above - these should be the default.