Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Multi-Touch Gestures on Linux: Easy Setup Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can add and configure multi-touch gestures on Linux using libinput-gestures or Touchégg. These tools let you swipe, pinch, and tap with multiple fingers to trigger actions like switching workspaces, minimizing windows, or controlling media. The easiest way is to install Touchégg, which has a graphical configurator, but libinput-gestures is more flexible for advanced users. Below are step-by-step instructions for both, plus troubleshooting and tips.

What You'll Need

  • A Linux distribution (Ubuntu, Fedora, Arch, etc.) with an X11 session (Wayland support is limited; see FAQ).
  • A laptop touchpad or external touchpad that supports multi-touch (most modern ones do).
  • Root/sudo access to install packages.
  • For libinput-gestures: the xdotool package (for simulating key presses) and wtype if you're on Wayland (though libinput-gestures mainly works on X11).
  • Internet connection to download packages.

Step-by-Step

Option A: Using Touchégg (Easiest, with GUI)

  1. Install Touchégg – On Ubuntu/Debian, open a terminal and run: sudo apt install touchegg. On Fedora, use sudo dnf install touchegg. For Arch, sudo pacman -S touchegg. If not in your repos, download the .deb or .rpm from the official GitHub releases page (search "Touchégg releases").
  2. Start Touchégg – After installation, start it from your application menu or run touchegg & in a terminal. It runs in the background.
  3. Open the configuration GUI – Touchégg comes with a graphical configurator. Launch it from your app menu (look for "Touchégg GUI") or run touchegg-ui in a terminal. If the GUI isn't installed, install it with sudo apt install touchegg-ui (or equivalent).
  4. Configure gestures – In the GUI, you'll see a list of gestures (e.g., "Swipe up with 3 fingers", "Pinch out"). Click on a gesture, then choose an action from the dropdown (like "Switch to next workspace", "Minimize window", or "Send key combination"). You can also set a custom command.
  5. Apply and test – Click "Apply" and test the gesture on your touchpad. If it doesn't work, check that Touchégg is running (look for the icon in your system tray).

Option B: Using libinput-gestures (More Flexible, Text Config)

  1. Install dependencies – Open a terminal and install xdotool (for X11) and wtype (if you're on Wayland, though libinput-gestures is primarily for X11). On Ubuntu: sudo apt install xdotool wtype. On Fedora: sudo dnf install xdotool wtype.
  2. Install libinput-gestures – Clone the repository and run the install script: git clone https://github.com/bulletmark/libinput-gestures.git, then cd libinput-gestures and sudo make install.
  3. Add your user to the input group – Run sudo gpasswd -a $USER input. This gives your user permission to read touchpad events. Log out and back in for this to take effect.
  4. Create a configuration file – Copy the default config: cp /etc/libinput-gestures.conf ~/.config/libinput-gestures.conf. Edit it with any text editor.
  5. Define your gestures – In the config file, each line defines a gesture. For example, to switch workspaces with a three-finger swipe up, add: gesture swipe up 3 xdotool key super+Page_Up. To minimize the current window with a three-finger tap, add: gesture tap 3 xdotool key super+h. You can also use wtype for Wayland, but note that libinput-gestures is not fully supported on Wayland.
  6. Start libinput-gestures – Run libinput-gestures-setup start to start it. To make it start automatically on login, run libinput-gestures-setup autostart.
  7. Test your gestures – Try the gestures you defined. If they don't work, check the troubleshooting section below.

Common Mistakes

  • Not adding user to input group – For libinput-gestures, if you skip step 3, the tool won't have permission to read touchpad events, and gestures will silently fail.
  • Using the wrong gesture syntax – In libinput-gestures, the syntax is gesture [swipe|pinch|tap] [direction] [finger_count] [command]. A common mistake is omitting the finger count or using an invalid direction (e.g., "left" instead of "right").
  • Conflicting with existing touchpad settings – Some desktop environments (like GNOME) have built-in gestures that may conflict. Disable those in your system settings if gestures trigger twice.
  • Running on Wayland – Touchégg works on Wayland, but libinput-gestures does not. If you're on Wayland, stick with Touchégg or switch to X11 session.

Tips

  • Start with three-finger gestures – They are the most common and less likely to trigger accidentally.
  • Use xdotool for key combinations – You can bind gestures to any key combination, like xdotool key ctrl+alt+Left to switch workspaces.
  • Test with a single gesture first – Add one gesture, test it, then add more. This makes it easier to isolate problems.
  • Check your touchpad's multi-touch support – Use libinput list-devices to see if your touchpad supports multi-touch (look for "Touchpad" and "Multitouch" capabilities).
  • Use the GUI for Touchégg – The GUI is much easier for beginners; you can see exactly what each gesture does.

Troubleshooting

  1. Gestures not working at all – First, restart the gesture daemon: for Touchégg, run killall touchegg && touchegg &. For libinput-gestures, run libinput-gestures-setup restart. Then check if the daemon is running with ps aux | grep touchegg or ps aux | grep libinput-gestures.
  2. Permission errors – If you see "Permission denied" in logs, you likely forgot to add your user to the input group. Run sudo gpasswd -a $USER input and log out/in.
  3. Gestures work but trigger wrong actions – Double-check your config syntax. For libinput-gestures, ensure the command is correct (e.g., xdotool key super+Page_Up). For Touchégg, verify the action in the GUI.
  4. Only some gestures work – Some touchpads have limited multi-touch support. Check with libinput debug-events to see if the touchpad sends the events. If not, your hardware may not support that gesture.
  5. Conflicts with desktop environment – If gestures trigger twice, disable the built-in gestures in your system settings (e.g., GNOME's "Workspaces" settings).
  6. Touchégg GUI not opening – Ensure you installed the touchegg-ui package separately. If not, run sudo apt install touchegg-ui (or your distro's equivalent).

Frequently Asked Questions

Does this work on Wayland?

Touchégg works on Wayland, but libinput-gestures does not (it relies on X11). If you're on Wayland, use Touchégg. For libinput-gestures, you need to switch to an X11 session (usually available at the login screen).

Can I use these gestures on a desktop with a mouse?

No, these tools are for touchpads only. For a mouse, you'd need a different tool like easystroke for mouse gestures, but that's not multi-touch.

How do I remove a gesture?

For Touchégg, open the GUI, select the gesture, and delete it or set it to "None". For libinput-gestures, comment out the line in the config file (add # at the start) and restart the daemon.

Can I configure different gestures for different applications?

Touchégg allows per-application gestures (you can set a gesture to only work in a specific app). libinput-gestures does not have this feature natively; you'd need to write a script that checks the active window.

Why do my gestures sometimes trigger accidentally?

This can happen if you have a low threshold. In Touchégg, you can adjust the sensitivity in the GUI. For libinput-gestures, you can edit the config file to require a longer swipe distance or a longer press time.

Is it possible to use four-finger gestures?

Yes, both tools support up to four fingers (or more, depending on your touchpad). Just specify the finger count in the config or GUI.