NOTE: i ended up finally learning how to properly use Workspaces in Ubuntu and no longer use the swipe gesture. They were wonky anyway, middle click was still pasting things in the end.. The touchpad on a Lenove Thinkpad is good, better than any HP or Acer i have ever used, but still doesn’t compare to one on a MacBook
FYI:
Add yourself to the input
group.
1# must be a part of the 'input' group to have permission to read touchpad device
2sudo gpasswd -a $USER input
Logout completely to assign this group and log back in (or reboot). You can confirm that you were added to the group with groups
Loggin out/in didn’t work for me so went ahead and rebooted..
1# install xdotool for keyboard input and wmctrl for Window Manager control
2sudo apt install -y xdotool wmctrl
3
4# install libinput-tools
5sudo apt install libinput-tools
6
7# install dependencies for Gestures GUI
8sudo apt install -y python3 python3-setuptools python3-gi python-gobject
9
10# install libinput-gestures from its repo
11cd /home/${USER}/Downloads/
12git clone https://github.com/bulletmark/libinput-gestures.git
13cd libinput-gestures
14# sudo make install
15# OR
16sudo ./libinput-gestures-setup install
17
18# Install the Gestures GUI from it's git repo
19cd /home/${USER}/Downloads/
20git clone https://gitlab.com/cunidev/gestures
21cd gestures
22sudo python3 setup.py install
23
24# start and set it to start automatically on boot
25libinput-gestures-setup autostart
26libinput-gestures-setup start
27
28# cleanup
29cd /home/${USER}/Downloads/
30sudo rm -rf ibinput-gestures gestures
31sudo apt autoremove -y
xdotool
to stimulate keyboard inputwmctrl
to control Window Managerlibinput-tools
on Ubuntulibinput
supports both pinch and swipe gesturesIf you want to use 3 finger gestures, and your touchpad also detects 3 finger tap as middle click, then you may wanna disable the middle click if you want to use 3 finger gestures.. synclient TapButton3=0
1# Disable middle click in order to use 3 finger gestures
2sudo apt install xserver-xorg-input-synaptics
3synclient TapButton3=0
If this doesn’t work, you can disable it in Gnome Tweaks: Tweaks > Keyboard & Mouse > Disable ‘Middle click Paste’
At this point you are ready to start defining your gestures using the GUI
xdotool
xdotool key super
notify-send
notify-send "Swiped up"
Gesture | Function | Command |
---|---|---|
3 Finger swipe UP | Expose (see all open apps) | xdotool key super |
3 Finger swipe DOWN | Expose (see all open apps) | xdotool key super |
3 Finger swipe LEFT | Move to prev workspace | xdotool key super+Page_Up |
3 Finger swipe RIGHT | Move to next workspace | xdotool key super+Page_Down |
You can find a list of Keyboard shortcuts and the key combinations in Settings > Devices > Keyboard
I have a 3 monitor setup and by default, switching the Workspace only switches the active screen, not all monitor screens change.. You can disable this behaviour with Gnome Tweaks
1sudo apt install gnome-tweaks
Run Tweaks. Under settings for Workspaces, set Workspaces spans displays
/etc/libinput-gestures.conf
~/.config/libinput-gestures.conf
The user file overrides the system defaults. The system config file is very nicely commented and you may wanna have a look if you want to understand what’s happening.. Here’s a sample of my config
1# ~/.config/libinput-gestures.conf
2
3# Gestures
4gesture swipe up 3 xdotool key super
5gesture swipe down 3 xdotool key super
6gesture swipe left 3 xdotool key super+Page_Up
7gesture swipe right 3 xdotool key super+Page_Down
What the Gestures GUI does is basically give you a user interface where you can add your gestures and commands for them. Underneath, it just writes to a user’s libinput-gestures.conf
file