How to Fix Touchpad Gestures on Lubuntu (Touchegg & libinput-gestures)
How to Fix Touchpad Gestures on Lubuntu (Touchegg & libinput-gestures)
I'm not certain which exact hardware and Lubuntu version you have, but most touchpad gesture problems on Lubuntu stem from the same root causes: the system using the wrong driver (synaptics vs libinput), LXQt not providing gesture handling by default, and missing user-space gesture daemons.
This tutorial gives a complete, practical, and reproducible workflow for diagnosing the touchpad, switching to the correct driver, enabling basic touchpad features, and adding robust multi-finger gestures using two modern, supported approaches: Touchegg (recommended) and libinput-gestures (legacy but still widely used). It includes the exact commands to run, how to persist settings across reboots, how to verify hardware capability, and fallback steps for hardware that lacks multi-finger support.
The commands and procedures are written for Debian/Ubuntu derivatives (Lubuntu) and assume you have sudo privileges and an internet connection. If you prefer copy-and-paste, every command is provided verbatim. The tutorial also explains the why behind each step so you can adapt it to other distributions or different kernels.
Step 1: Confirm the Active Touchpad Driver
Start by confirming the kernel sees the touchpad and which driver is active. Run:
xinput list
Look for an entry that looks like a touchpad (names vary: ETPS/2 Elantech Touchpad, SynPS/2 Synaptics TouchPad, DLL07BE:01 06CB:76AD Touchpad, etc.). Note the device id number. Then run:
xinput list-props <device-id>
If the properties mention "libinput" (for example "libinput Tapping Enabled"), your system is already using libinput. If the properties mention "Synaptics" or the device name contains "Synaptics", the synaptics driver is in use and you should switch to libinput for modern gesture support. The libinput library is the upstream input stack used by most modern Linux desktops and is documented by the libinput project; it is the canonical source for how gestures and touchpad features are exposed to userland.
Step 2: Switching to Libinput
If synaptics is installed, remove it and install libinput. On Lubuntu run:
sudo apt update
sudo apt purge xserver-xorg-input-synaptics
sudo apt install xserver-xorg-input-libinput libinput-tools
Reboot after this change. Removing synaptics forces X to use libinput, which exposes the properties and events needed by gesture daemons. Confirm again with xinput list-props that the device now shows libinput properties. The libinput project documents the device properties and how to query events; use libinput debug-events to watch raw events while you swipe or tap.
Step 3: Enable Basic Touchpad Features
Enable basic touchpad features (tap to click, natural scrolling) with xinput so you can test immediately. Replace <device-id> with the id from xinput list:
xinput set-prop <device-id> "libinput Tapping Enabled" 1
xinput set-prop <device-id> "libinput Natural Scrolling Enabled" 1
xinput set-prop <device-id> "libinput Accel Speed" 0.2
These xinput changes are immediate but not persistent. To persist them, add the same commands to ~/.xprofile or ~/.profile (Lubuntu sources ~/.profile on login) or create an LXQt autostart script. For system-wide persistent configuration you can create an Xorg conf snippet in /etc/X11/xorg.conf.d/90-touchpad.conf with libinput options.
Step 4: Verify Multi-Touch Support
If you want to inspect raw events to confirm multi-finger support, use:
sudo libinput debug-events --verbose
Perform one, two, and three finger gestures while watching the output. If the device reports BTN_TOOL_TRIPLETAP, ABS_MT_POSITION_X/Y, or multiple touch slots, the hardware supports multi-touch and is capable of multi-finger gestures. If the device only reports single-touch events, the hardware itself is limited and no software daemon will create true multi-finger gestures.
Option A: Touchegg (Recommended)
Touchegg is a modern, actively maintained gesture daemon that integrates well with lightweight desktops. It runs as a user service, reads a JSON configuration, and maps multi-finger gestures to desktop actions, keyboard shortcuts, or shell commands. Touchegg is recommended because it is maintained, supports Wayland and X11 (depending on build), and has GUI frontends on many distros.
Install Touchegg on Lubuntu:
sudo apt update
sudo apt install touchegg
If your distribution does not have a recent package, install from the project's releases or use the snap/flatpak if available. After installation, enable and start the user service:
systemctl --user enable --now touchegg
Create or edit the configuration file at ~/.config/touchegg/touchegg.conf or ~/.config/touchegg/touchegg.json depending on the version. A minimal example mapping three-finger swipe left/right to workspace switching and three-finger tap to middle-click looks like this:
{
"applications": {},
"gestures": [
{
"type": "DRAG",
"fingers": 3,
"direction": "LEFT",
"action": {
"type": "COMMAND",
"command": "xdotool set_desktop --relative 1"
}
},
{
"type": "DRAG",
"fingers": 3,
"direction": "RIGHT",
"action": {
"type": "COMMAND",
"command": "xdotool set_desktop --relative -1"
}
},
{
"type": "TAP",
"fingers": 3,
"action": {
"type": "COMMAND",
"command": "xdotool click 2"
}
}
]
}
Use xdotool or wmctrl commands to implement workspace switching or other actions. After editing the config, restart the service:
systemctl --user restart touchegg
Test gestures. If gestures do not trigger, check the user service status and logs:
systemctl --user status touchegg
journalctl --user -u touchegg --since "5 minutes ago"
Option B: libinput-gestures (Legacy, widely used)
libinput-gestures is a lightweight wrapper that reads libinput events and maps them to commands. It requires libinput-tools, xdotool, and wmctrl. Note that libinput-gestures runs under X11 and is not a Wayland solution. If you use X11, this remains a practical option.
Install and enable libinput-gestures:
sudo apt update
sudo apt install libinput-tools xdotool wmctrl
sudo gpasswd -a $USER input
git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures
sudo make install
libinput-gestures-setup autostart start
Create or edit ~/.config/libinput-gestures.conf with mappings. A compact example:
gesture swipe left 3 xdotool set_desktop --relative 1
gesture swipe right 3 xdotool set_desktop --relative -1
gesture swipe up 3 xdotool key super
gesture swipe down 3 xdotool key super
After saving, restart the daemon:
libinput-gestures-setup restart
Choosing Between the Two
Touchegg is the modern, cross-compositor choice and is actively maintained with GUI frontends and Wayland support in many distributions. libinput-gestures is simple and works well on X11 but is less future-proof. If you plan to use Wayland or want a GUI for configuration, prefer Touchegg. If you are on X11 and want a minimal, scriptable solution, libinput-gestures is fine.
Troubleshooting Checklist
- Confirm hardware multi-touch:
sudo libinput debug-events --verbosewhile performing gestures. If the device reports only single-touch, gestures are impossible. - Confirm libinput driver:
xinput list-props <id>should show libinput properties. If not, remove synaptics and install xserver-xorg-input-libinput. - Confirm daemon running:
systemctl --user status toucheggorlibinput-gestures-setup status. - Check permissions: ensure your user is in the input group (
sudo gpasswd -a $USER input) and re-login. - Check logs:
journalctl --user -u toucheggor check~/.config/libinput-gestures.logfor errors. - Confirm compositor conflicts: LXQt is lightweight and does not intercept gestures; however, if you run a compositor like picom or a Wayland compositor, ensure it does not capture gestures before the daemon.
If you want a ready-to-drop file tailored to your exact touchpad model and Lubuntu version, paste the output of xinput list and sudo libinput debug-events --verbose in the comments below, and I'll generate the precise config and autostart entries you can copy into place.
Comments
Post a Comment