Gestures on Ubuntu 18.04(Xorg)

Gestures / Multi-Touch enabling on Ubuntu with Fusuma

Prerequisite:

Image for post
Image for post

Please make sure that the ‘Xorg’ display server is being used.
To verify if the Xorg is being used, enter the following code snippet in the terminal.

$ echo $XDG_SESSION_TYPE.

If the response printed in ‘x11’, then the account is logged in as Xorg.
If you see ‘Wayland’, quite obviously, the display server in use is Wayland. Then you have to switch the display server.

Steps:

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

sudo gpasswd -a $USER input

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

sudo apt-get install libinput-tools  sudo apt-get 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.

Create a directory called fusuma inside the .config path. In there, create a file called config.xml and open it up using nano-editor to add the desired gesture commands.

$ mkdir -p ~/.config/fusuma        # create config directory
$ nano ~/.config/fusuma/config.yml # edit config file.

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+Left'
right:
command: 'xdotool key alt+Right'
up:
command: 'xdotool key ctrl+t'
threshold: 1.5
down:
command: 'xdotool key ctrl+w'
threshold: 1.5
4:
left:
command: 'xdotool key super+Left'
right:
command: 'xdotool key super+Right'
up:
command: 'xdotool key super+a'
down:
command: 'xdotool key super+s'
pinch:
2:
in:
command: 'xdotool key ctrl+plus'
threshold: 0.1
out:
command: 'xdotool key ctrl+minus'
threshold: 0.1
threshold:
swipe: 0.4
pinch: 0.4
interval:
swipe: 0.8
pinch: 0.1
// --or replace above with default below--
threshold:
swipe: 1
pinch: 1

interval:
swipe: 1
pinch: 1

After pasting, click on Ctrl+O to save the changes in Nano Editor and Ctrl+X to exit the nano editor.

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

Mult-touch Gesture | Action |

3 Fingers — Left | Slide Left|
3 Fingers — Right | Slide Right |
3 Fingers — Up | Show all Windows|
3 Fingers — Down | Close Exposé (Esc) |

4 Fingers — Left | Next Desktop |
4 Fingers — Right | Previous Desktop|
4 Fingers — Up | All Applications|
4 Fingers — Down | Active Applications |

2 Fingers — Pinch In — Zoom In in Browser
2 FIngers — Pinch Out — Zoom Out in Browser

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.

To add it to the Startup;

  1. Check the path where you installed fusuma with $ which fusuma
  2. Open $ gnome-session-properties
  3. Add Fusuma and enter the location where the above path was checked in the command input field
  4. Add the -d option at the end of the command input field as in below.
Image for post
Image for post

For more info and updates: Fusuma Git Readme

Update (10/05):
This enables to switch between desktops with 3 finger swipe up and down.

swipe:
3:
left:
command: 'xdotool key alt+Left'
right:
command: 'xdotool key alt+Right'
up:
command: 'xdotool key ctrl+alt+Up'
threshold: 1.5
down:
command: 'xdotool key ctrl+alt+Down'
threshold: 1.5

Written by

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store