58

Out of the box, I get gestures for scrolling and right clicking. I'm very interested in three finger gestures (like slide three fingers up to see all open windows), but it seems there is no way to get those working.

I have tried with the Extended Gestures GNOME-shell extension and touchegg, neither of which are working.

Any ideas on how to get these?

Misguided
  • 879

6 Answers6

94

Fusuma

I am using XPS 15 with Ubuntu 18.04 (X.org). I have managed to get multi-gestures working for me. Kohei Yamada has developed an application called Fusuma to enable multi-touch gestures on Linux. It requires you to install Ruby on your machine if it isn't already installed.

Follow the instructions from fusuma GitHub's Readme page or you could follow these steps which worked for me:

First of all check if your current user is part of the input group. You can do that by

groups $USER | grep -w input # To check
sudo gpasswd -a $USER input  # To add

Then log out and log back in. Now install xdotool and libinput-tools.

sudo apt install libinput-tools  
sudo apt install xdotool

If you haven't installed Ruby you can do that now:

sudo apt install ruby  

Now install fusuma

sudo gem install fusuma  

Deciding your gestures

This is basically creating a .yml file with the desired configuration. If you want standard gestures you can follow these instructions or feel free to tweak around to get desired gestures.

Go to your config folder in home directory.

cd ~/.config    

Now create a folder named fusuma

mkdir fusuma  
cd fusuma

In there create a file called config.yml

touch config.yml   

Now you can use your favourite text editor to enter the contents in this file.

nano config.yml   

Copy and paste the following instructions if you are using GNOME, which is the default environment in 18.04.

swipe:
  3: 
    left: 
      command: 'xdotool key alt+Right'
    right: 
      command: 'xdotool key alt+Left'
    up: 
      command: 'xdotool key super'
    down: 
      command: 'xdotool key super'
  4:
    left: 
      command: 'xdotool key ctrl+alt+Down'
    right: 
      command: 'xdotool key ctrl+alt+Up'
    up: 
      command: 'xdotool key ctrl+alt+Down'
    down: 
      command: 'xdotool key ctrl+alt+Up'
pinch:
  in:
    command: 'xdotool key ctrl+plus'
  out:
     command: 'xdotool key ctrl+minus'

threshold: swipe: 0.4 pinch: 0.4

interval: swipe: 0.8 pinch: 0.1

Note that the gestures that this configuration has created for you are the following:

Mult-touch GestureAction
3 Fingers - Left → Go Next on Browser
3 Fingers - Right → Go Back on Browser
3 Fingers - Up → Show all Windows
3 Fingers - Down → Close Exposé (Esc
4 Fingers - Left → Next Deskto
4 Fingers - Right → Previous Desktop
4 Fingers - Up → Next Desktop
4 Fingers - Down → Previous Deskto

After this you can run the command in terminal to test if it has installed

sudo fusuma 

nothing will happen in the terminal. Just start using your multi-touch gestures - swipe away on your touchpad.

Now all you have to do is add Fusuma and the command for it in your start-up applications.

Pablo Bianchi
  • 15,657
  • 1
    even though this works, it's not a packaged app that can be used by any user, needs minimal technical expertise. But yeah, it does work great – akxer Jun 27 '18 at 10:40
  • thanks akabhirav. I don't know how to make packaged apps but I would love to st art... can this one be repurposed into a package? and would you be willing to help me do that? – Rachit Kinger Jun 28 '18 at 10:52
  • I don't have much experience with it, I was looking into it and found an easy way to do it. Go here - https://github.com/phusion/traveling-ruby. Sorry, can't be of much help, but if you need any help with writing code do reply – akxer Jun 28 '18 at 12:10
  • Looks great! Thanks for the pointer, akabhirav – Rachit Kinger Jun 29 '18 at 05:01
  • 1
    Works great! Thanks a lot. Note, it should be: sudo gem install fusuma – mace Sep 17 '18 at 07:44
  • 1
    Hey @RachitKinger thanks for the detailed steps, just one suggestion, after the "mkdir fusuma" step, just add the command to enter into the folder that's just been created, because people new to Linux may directly paste and run the next step "touch config.yml", which will result in the config file being generated outside of the fusuma directory. – Ghos3t Oct 12 '18 at 17:58
  • 2
    Thanks for the suggestion @Ghos3t while I have mentioned that the config file should be created inside the fusuma folder, I guess you are right that if one looks only at the code then one is likely to miss that. I have added a line to change directory now. – Rachit Kinger Oct 14 '18 at 04:38
  • Does it works with Kubuntu? – Mike Brian Olivera Feb 20 '19 at 22:40
  • @Mike sorry I haven't tried that – Rachit Kinger Feb 21 '19 at 12:20
  • Great answer, thanks! How can we make it automatically work on startup? Is sudo problematic if startup applications? – Alkis Mavridis Aug 27 '19 at 09:41
  • 1
    @AlkisMavridis I just used the Startup Applications Tool to add the command "fusuma" without "sudo". Don't know if thats the best solution, but it works for me. – Doc Dec 21 '19 at 17:33
  • @RachitKinger 4 finger gesture does not work for me, they launching super left/right instead of ctrl alt left/right, 3 finger works as expected – Erik Kubica Jun 22 '20 at 11:28
  • @ErikKubica sorry, I'm not using XPS-15 and 18.04 any longer so I can't test that for you. Perhaps someone in the thread can help – Rachit Kinger Jun 22 '20 at 11:34
  • 1
    @RachitKinger i figured it out, i was running it as root and it laoded different config. but i have issue with the pinch. in all apps itþs broken, for example in chrome, i pinch zoom and it switches to the first tab, then the system freezes for like 10 seconds and the page is instantly zoomed out to 10%, same in photo viewer, file manager,... i guess welcome in opensource world :D – Erik Kubica Jun 22 '20 at 14:55
  • Great. Just two things: no need for sudo in sudo fusuma.. and it could get a bit more instructive on the 'adding to start-up' part. – arsaKasra Aug 17 '20 at 07:09
9

Ubuntu 18.04 uses X.Org as the default display server instead of Wayland. The mentioned Extended Gestures extension currently works only with Wayland.

What you need to do is choose Wayland while logging in after a restart. This link shows the same procedure but the other way around (from Wayland to X.Org).

Pablo Bianchi
  • 15,657
2

Simply search for "Startup application" by pressing the super key (windows key in my case) then add a new application. Add the command fusuma and then reboot to test it.

sudo apt install libinput-tools ruby
sudo gem install fusuma
sudo apt install xdotool # Optional: For sending shortcuts

Working on 18.10 (XPS 9570).

Pablo Bianchi
  • 15,657
1

I use Comfortable Swipe

Comfortable 3-finger and 4-finger swipe gesture using Xdotool in native C++

which I feel perform better than fusuma.

Pablo Bianchi
  • 15,657
1

You can simply download "Extended Gestures" from Ubuntu Software! but, it depends on your PC and doesn't work properly for all PCs

OR if you prefer the hard way, install "Ubuntu touchpad Gestures":

  1. Download the zip file from this link which contains the installation script

  2. Run the following command in the terminal to install the dependencies and download, compile and install the latest source code:

    chmod +x gestures-install.sh
    sudo sh gestures-install.sh
    
  3. After rebooting to complete the installation, open "Gestures" from the application menu.

Now, you can customize your own gestures!

screenshot

Use the following command to remove it using the same script:

sudo sh gestures-install.sh --remove
Pablo Bianchi
  • 15,657
0

I use libinput-gestures with the following configuration:

# Browser go forward (works only for Xorg, and Xwayland clients)
gesture swipe left 3 xdotool key alt+Right

Browser go back (works only for Xorg, and Xwayland clients)

gesture swipe right 3 xdotool key alt+Left

Pablo Bianchi
  • 15,657
pwaterz
  • 201