Comprehensive Guide: Setting Up Gestures on Linux (Debian-Based Distributions)
Date: 2-1-2025
One of the features that Windows and macOS users often miss when transitioning to Linux is the native support for multitouch gestures. Linux distributions like Ubuntu and Kali don’t come with pre-installed gesture support, but this functionality can be achieved with a bit of setup using tools like Touchégg.
In this guide, we’ll walk through setting up multitouch gestures on Linux, step by step, including adding specific gestures for switching applications, managing workspaces, and more.
What is Touchégg?
Touchégg is a multitouch gesture recognizer for Linux that enhances the user experience by allowing you to define custom gestures for various actions, like switching between applications, workspaces, or maximizing windows.
Setting Up Gestures on Linux
Step 1: Install Touchégg
Touchégg can be installed using the following commands:
On Ubuntu/Debian-based systems:
sudo apt update
sudo apt install touchegg
On Kali Linux:
Add the non-free
repository if not enabled, then install:
sudo apt update
sudo apt install touchegg
On Fedora-based systems:
Use the package manager:
sudo dnf install touchegg
Step 2: Install Touché for Gesture Control
While Touchégg handles the gesture backend, Touché is a GUI application to manage and configure Touchégg effortlessly.
Install Touché:
sudo apt install touche
Step 3: Configure Touchégg for Custom Gestures
Touchégg uses a configuration file stored at ~/.config/touchegg/touchegg.conf
. You can customize this file to define gestures for specific actions.
Default Configuration Location:
Create or edit the configuration file:
mkdir -p ~/.config/touchegg
nano ~/.config/touchegg/touchegg.conf
Step 4: Add Gestures to the Configuration
Here’s an example configuration file that includes gestures for:
- Switching between applications (Alt+Tab equivalent).
- Switching workspaces.
- Maximizing, minimizing, and closing windows.
- Showing the desktop and GNOME shell overview.
Full Touchégg Configuration File:
<touchégg>
<settings>
<property name="animation_delay">150</property>
<property name="action_execute_threshold">20</property>
<property name="color">auto</property>
</settings>
<application name="All">
<!-- 3 finger swipe up/down for window maximize/minimize -->
<gesture type="SWIPE" fingers="3" direction="UP">
<action type="MAXIMIZE_RESTORE_WINDOW">
<animate>true</animate>
</action>
</gesture>
<gesture type="SWIPE" fingers="3" direction="DOWN">
<action type="MINIMIZE_WINDOW">
<animate>true</animate>
</action>
</gesture>
<!-- 3 finger swipe left/right for workspace switching -->
<gesture type="SWIPE" fingers="3" direction="LEFT">
<action type="CHANGE_DESKTOP">
<direction>next</direction>
<animate>true</animate>
</action>
</gesture>
<gesture type="SWIPE" fingers="3" direction="RIGHT">
<action type="CHANGE_DESKTOP">
<direction>previous</direction>
<animate>true</animate>
</action>
</gesture>
<!-- 4 finger swipe left/right for application switching -->
<gesture type="SWIPE" fingers="4" direction="LEFT">
<action type="SWITCH_APPLICATION">
<direction>next</direction>
<animate>true</animate>
</action>
</gesture>
<gesture type="SWIPE" fingers="4" direction="RIGHT">
<action type="SWITCH_APPLICATION">
<direction>previous</direction>
<animate>true</animate>
</action>
</gesture>
<!-- 4 finger pinch for window close -->
<gesture type="PINCH" fingers="4" direction="IN">
<action type="CLOSE_WINDOW">
<animate>true</animate>
<color>F84A53</color>
</action>
</gesture>
<!-- 4 finger swipe up/down for show desktop/show windows -->
<gesture type="SWIPE" fingers="4" direction="DOWN">
<action type="SHOW_DESKTOP">
<animate>true</animate>
</action>
</gesture>
<gesture type="SWIPE" fingers="4" direction="UP">
<action type="GNOME_SHELL">
<action>overview</action>
</action>
</gesture>
</application>
</touchégg>
Step 5: Apply the Configuration
Restart Touchégg to apply your changes:
pkill touchegg && touchegg &
Step 6: Test Your Gestures
-
Switch Applications:
- 4-finger swipe left: Switch to the next application.
- 4-finger swipe right: Switch to the previous application.
-
Manage Windows:
- 3-finger swipe up: Maximize window.
- 3-finger swipe down: Minimize window.
-
Switch Workspaces:
- 3-finger swipe left: Next workspace.
- 3-finger swipe right: Previous workspace.
-
Show Desktop:
- 4-finger swipe down: Show desktop.
-
Close Window:
- 4-finger pinch inward: Close the active window.
Additional Tips and Tricks
Debugging Gesture Issues
If gestures don’t work as expected, verify the following:
- Ensure Touchégg is running:
ps aux | grep touchegg
- Check for configuration errors by running Touchégg manually:
touchegg
Customizing Gestures Further
Touchégg allows extensive customization. You can:
- Map gestures to keyboard shortcuts.
- Add application-specific gestures.
- Fine-tune animation speed and thresholds.
You're right to double-check! Here's a complete recap of all the necessary steps to ensure everything works smoothly. I'll verify I haven't missed anything:
Complete Steps
-
Install Touchégg:
- Ensure Touchégg is installed.
sudo apt update
sudo apt install touchegg
-
Create/Update the Configuration File:
- If the
~/.config/touchegg/touchegg.conf
file doesn't exist, create it:
mkdir -p ~/.config/touchegg nano ~/.config/touchegg/touchegg.conf
- If the
- Paste the updated configuration (provided in my previous response).
-
Set Permissions for the Configuration File:
- Ensure the configuration file has proper read/write permissions:
chmod 644 ~/.config/touchegg/touchegg.conf
-
Restart Touchégg:
- Restart Touchégg to apply the configuration:
pkill touchegg && touchegg &
-
Autostart Touchégg on Login (Optional but Recommended):
- Create a
.desktop
file to start Touchégg on login:
mkdir -p ~/.config/autostart nano ~/.config/autostart/touchegg.desktop
- Create a
-
Add the following content:
[Desktop Entry] Type=Application Exec=touchegg Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=Touchégg Comment=Multitouch gesture recognizer
-
Install Touché UI (Optional for Easy Configuration):
- If you want a GUI to tweak gestures:
sudo apt install touche touche
-
Verify Dependencies (Just in Case):
- Ensure you have dependencies like libinput for gesture support:
sudo apt install xdotool wmctrl libinput-tools
-
Test the Gestures:
- Try all gestures you’ve configured (maximize, minimize, workspace switching, application switching, etc.).
-
Check Logs for Debugging (if Issues Occur):
- If gestures aren’t working, check logs:
journalctl --user-unit=touchegg
Common Issues to Address
- Touchpad Support: Ensure your touchpad supports multi-touch gestures. Use this command to verify:
libinput list-devices
Look for multi-touch support in the output.
GNOME Environment Adjustments: If you're using GNOME, it may have conflicting gestures. You can use
gnome-tweaks
to disable GNOME's built-in gestures if needed.Animation Issues: If animations aren't working, try setting
<animate>false</animate>
for the gesture actions.
Let me know if anything still seems off or if you'd like clarification on a specific step!
Conclusion
Adding gesture support to Linux enhances productivity and bridges the gap for users transitioning from Windows or macOS. Tools like Touchégg and Touché make it easy to define gestures for multitasking, workspace management, and more.
By following this guide, you’ll transform your Linux experience with intuitive multitouch gestures that rival native solutions on other operating systems.
Let us know how gestures improve your workflow or share your custom configurations in the comments!
Top comments (0)