Configure the Touchpad and Multitouch Gestures
Configure Linux touchpad behavior and multitouch gestures using libinput, libinput-gestures, and native GNOME and KDE Plasma settings on both Wayland and X11.
Before you start
- ▸A laptop or desktop with a multitouch-capable touchpad (most hardware from 2015 onward)
- ▸sudo or root access to modify udev rules and install packages
- ▸Basic familiarity with editing config files in a terminal
Modern Linux touchpad support is built on libinput, which handles everything from basic pointer acceleration to multitouch gesture recognition. Whether you're on Wayland or X11, GNOME or KDE, the foundation is the same — but how you tune it differs significantly. This guide walks through libinput configuration, three-finger and four-finger gestures, and desktop-environment-specific settings, with notes on where Wayland changes the picture.
How libinput Fits In
libinput is the input handling library used by both the Wayland compositor and the X.Org server (via xf86-input-libinput). It reads raw events from the kernel and applies tap-to-click, palm detection, scroll filtering, and gesture recognition before passing events up the stack. Virtually all modern distributions use it by default — the older synaptics driver is deprecated and absent from most current installs.
To see which driver is in use under X11:
xinput list
xinput list-props "your-touchpad-name"
Under Wayland there is no xinput. Instead, inspect libinput directly:
sudo libinput list-devices
The output lists every input device with its capabilities. Find your touchpad entry and confirm Gestures: yes appears in its feature list.
Install and Use libinput-debug-events
Before tuning anything, verify the kernel and libinput actually see your gestures.
# Debian/Ubuntu
sudo apt install libinput-tools
# Fedora / RHEL family
sudo dnf install libinput
# Arch
sudo pacman -S libinput
Run the debug tool, then move fingers on the touchpad:
sudo libinput debug-events --show-keycodes
Three-finger swipes will emit GESTURE_SWIPE_BEGIN, GESTURE_SWIPE_UPDATE, and GESTURE_SWIPE_END events. If you see them, the hardware and driver layer are working correctly. Press Ctrl+C to stop.
Tuning libinput via udev Rules (All Desktops, Both X11 and Wayland)
The persistent, desktop-agnostic way to set libinput properties is a udev hwdb override. This works on X11 and Wayland because the settings are applied before any compositor or X server reads the device.
Find Your Device's Match String
sudo libinput list-devices | grep -A5 -i touchpad
Note the Kernel: path, e.g. /dev/input/event4, then run:
udevadm info --attribute-walk /dev/input/event4 | grep -E 'idVendor|idProduct|name'
Create the Override File
sudo nano /etc/udev/hwdb.d/99-touchpad.hwdb
A typical entry (substitute your vendor/product IDs):
evdev:input:b0011v0002p0007*
LIBINPUT_ATTR_TAP_ENABLED=1
LIBINPUT_ATTR_NATURAL_SCROLL_ENABLED=1
LIBINPUT_ATTR_POINTER_ACCEL=0.2
After saving, rebuild the hwdb and trigger the change without rebooting:
sudo systemd-hwdb update
sudo udevadm trigger /dev/input/event4
Common attribute keys: LIBINPUT_ATTR_TAP_ENABLED, LIBINPUT_ATTR_NATURAL_SCROLL_ENABLED, LIBINPUT_ATTR_POINTER_ACCEL (range −1.0 to 1.0), LIBINPUT_ATTR_DISABLE_WHILE_TYPING.
X11-Only: Tuning with an xorg.conf.d Snippet
If you are on X11 and prefer the traditional approach, drop a file in /etc/X11/xorg.conf.d/. This does not work under Wayland.
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
Driver "libinput"
Option "Tapping" "on"
Option "NaturalScrolling" "true"
Option "AccelSpeed" "0.2"
Option "DisableWhileTyping" "on"
Option "ClickMethod" "clickfinger"
EndSection
Restart the X session to apply. The ClickMethod option controls whether two-finger tap registers as a right-click (clickfinger) or a middle-click on three fingers (buttonareas).
Three-Finger and Four-Finger Gestures
libinput detects swipe and pinch gestures natively, but it does not bind them to actions on its own. You need a gesture daemon. The two most common choices are libinput-gestures (mature, config-file driven) and Fusuma (Ruby-based, more flexible).
libinput-gestures
# Debian/Ubuntu — install from GitHub or a PPA
sudo apt install libinput-gestures
# Arch (AUR)
git clone https://aur.archlinux.org/libinput-gestures.git
cd libinput-gestures && makepkg -si
# Add yourself to the input group (all distros)
sudo gpasswd -a $USER input
Log out and back in after adding yourself to the input group. Then copy the default config and edit it:
cp /etc/libinput-gestures.conf ~/.config/libinput-gestures.conf
nano ~/.config/libinput-gestures.conf
Example entries for a three-finger swipe on Wayland (using ydotool) and on X11 (using xdotool):
# Three-finger swipe left → switch workspace (X11)
gesture swipe left 3 xdotool key super+Right
# Three-finger swipe right → switch workspace (X11)
gesture swipe right 3 xdotool key super+Left
# Three-finger swipe up → show overview (X11/GNOME)
gesture swipe up 3 xdotool key super+s
# Pinch out → zoom in (X11)
gesture pinch out xdotool key plus
Under Wayland, replace xdotool with ydotool (install separately; requires the ydotoold daemon running). Alternatively, use wtype for text input events.
Enable and autostart:
libinput-gestures-setup autostart start
GNOME: Built-in and Extended Gesture Settings
GNOME 40+ on Wayland has native three-finger swipe gestures built into the compositor — three fingers left/right switches workspaces, three fingers up/down opens the Activities overview. These require no daemon.
Tune basic touchpad behavior in Settings → Mouse & Touchpad. For power users, use gsettings:
# Enable tap-to-click
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
# Natural scrolling
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll true
# Two-finger right-click
gsettings set org.gnome.desktop.peripherals.touchpad click-method 'fingers'
# Disable while typing
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing true
# Acceleration profile: 'default', 'flat', or 'adaptive'
gsettings set org.gnome.desktop.peripherals.touchpad accel-profile 'adaptive'
GNOME on X11 does not expose the native three-finger workspace gestures — use libinput-gestures in that case.
KDE Plasma: System Settings and Touchpad KCM
KDE Plasma has a dedicated System Settings → Input Devices → Touchpad panel (the kcm_touchpad module) that exposes most libinput options graphically, on both X11 and Wayland.
For gesture bindings under Plasma 5.24+ on Wayland, go to System Settings → Workspace Behavior → Touchpad Gestures. You can bind three-finger and four-finger swipes to actions like switching desktops, toggling Present Windows, or opening the application launcher.
On X11 with KDE, or if you need custom gesture commands, libinput-gestures works alongside KDE without conflict.
Apply settings via CLI using kwriteconfig5 if needed for scripting:
kwriteconfig5 --file kcminputrc --group Libinput --group 0003 --key TapToClick true
kbuildsycoca5 --noincremental
Verify Everything Is Working
# Check libinput sees your gestures live
sudo libinput debug-events | grep GESTURE
# Confirm libinput-gestures is running
libinput-gestures-setup status
# Confirm group membership took effect
id | grep input
If gestures fire but no action happens, verify xdotool or ydotool is installed and the relevant daemon (ydotoold) is running for Wayland setups.
Troubleshooting
- Gestures not detected at all: Run
sudo libinput debug-events. If noGESTURE_SWIPElines appear, the kernel driver may not support multitouch — checkdmesg | grep -i inputand confirm the touchpad is not falling back to a PS/2 mouse-only mode. - Permission denied without sudo: You have not been added to the
inputgroup, or you have not logged out and back in since doing so. Verify withid. - libinput-gestures starts but gestures do nothing (Wayland):
xdotooldoes not work under a pure Wayland session. Installydotool, startydotooldas a user service, and update your config to useydotool key .... - Palm rejection is too aggressive or not aggressive enough: This is controlled by libinput's internal heuristics and is not currently exposed as a simple config knob. Filing a bug with your touchpad's hwdb match string and
libinput recordoutput is the right path. - Conflict between GNOME native gestures and libinput-gestures: GNOME's Mutter consumes three-finger events on Wayland before they reach libinput-gestures. Use four-finger gestures in your libinput-gestures config for custom actions, and leave three-finger gestures to GNOME.
Frequently asked questions
- Does libinput-gestures work under Wayland?
- It detects gestures correctly under Wayland since it reads directly from the input device, but xdotool does not work in a Wayland session. Replace xdotool commands with ydotool and run the ydotoold daemon as a user service.
- Why do GNOME's built-in three-finger gestures conflict with my custom ones?
- GNOME's Mutter compositor on Wayland consumes three-finger swipe events before they reach any external gesture daemon. Use four-finger gestures in libinput-gestures for custom bindings and reserve three-finger gestures for GNOME's native workspace and overview actions.
- How do I make tap-to-click persist across reboots without a desktop environment GUI?
- Either use the udev hwdb method (LIBINPUT_ATTR_TAP_ENABLED=1 in /etc/udev/hwdb.d/) for a session-agnostic solution, or add the Option "Tapping" "on" line to an xorg.conf.d InputClass section for X11 sessions.
- My touchpad shows as a pointer device only, not a touchpad — why?
- The kernel may be loading a basic PS/2 or HID mouse driver instead of a multitouch-capable one. Check 'dmesg | grep -i input' for the driver name. Some cheap or older touchpads simply lack multitouch firmware support at the hardware level.
- Can I adjust scroll speed separately from pointer acceleration?
- libinput does not expose a scroll speed multiplier through a simple property. The closest control is LIBINPUT_ATTR_POINTER_ACCEL for overall speed. For scroll-specific tuning, GNOME and KDE offer scroll speed sliders in their Settings panels that apply a software multiplier on top of libinput.
Related guides
Linux Clipboards Explained (+ Clipboard Managers)
Learn the difference between Linux's PRIMARY and CLIPBOARD selections, use xclip, xsel, and wl-clipboard from the terminal, and manage history with GPaste or Klipper.
Configure LibreOffice for Daily Use
Configure LibreOffice for daily use: set default save formats for MS Office interop, tune autosave, install fonts, and add productivity extensions.
Wayland vs X11: How to Choose and Configure Each
Know when to run Wayland or X11, how to check your current session, switch at login with GDM/SDDM/LightDM, and handle NVIDIA and XWayland edge cases.
How to Customize KDE Plasma
Customize KDE Plasma with themes, widgets, activities, and System Settings tweaks. Covers all major distros, Wayland, and config file locations.