This fork focuses on high-performance three-finger dragging with optimizations for both X11 and Wayland.
For technical details, see: riley-martin#6
Pre-compiled binaries: https://github.com/ferstar/gestures/releases
Install via cargo:
cargo install --git https://github.com/ferstar/gestures.git
A libinput-based touchpad gesture handler that executes commands based on gestures. Unlike alternatives, it uses the libinput API directly for better performance and reliability.
- Platform Support: Both X11 and Wayland
- High Performance:
- X11: Direct libxdo API for minimal latency
- Wayland: Optimized ydotool integration with 60 FPS throttling
- Thread pool for command execution (4 workers, prevents PID exhaustion)
- Gesture Types: Swipe (8 directions + any), Pinch, Hold
- Advanced Features:
- Mouse acceleration and delay for smooth 3-finger dragging
- Real-time config reload via IPC
- Graceful shutdown (SIGTERM/SIGINT)
See config.md for detailed configuration instructions.
# Generate default config file
gestures generate-config
# Preview config without installing
gestures generate-config --print
# Force overwrite existing config
gestures generate-config --force// 3-finger drag (works on both X11 and Wayland)
swipe direction="any" fingers=3 mouse-up-delay=500 acceleration=20
// 4-finger workspace switching
swipe direction="w" fingers=4 end="hyprctl dispatch workspace e-1"
swipe direction="e" fingers=4 end="hyprctl dispatch workspace e+1"System packages:
libudev-dev/libudev-devellibinput-dev/libinput-devellibxdo-dev/libxdo-devel
Runtime dependencies:
- X11:
xdotool(for 3-finger drag) - Wayland:
ydotool+ydotoolddaemon (for 3-finger drag)- If your distribution package has issues, try the official ydotool binaries from GitHub releases
cargo install --git https://github.com/ferstar/gestures.gitgit clone https://github.com/ferstar/gestures
cd gestures
cargo build --release
sudo cp target/release/gestures /usr/local/bin/# flake.nix
{
inputs.gestures.url = "github:ferstar/gestures";
# Then add to packages:
# inputs.gestures.packages.${system}.gestures
}# 1. Generate config file (first time only)
gestures generate-config
# 2. Install service file
gestures install-service
# 3. Enable and start the service
systemctl --user enable --now gestures.service# Auto-detect display server (X11 or Wayland)
gestures start
# Force Wayland mode (if needed)
gestures --wayland start
# Force X11 mode (if needed)
gestures --x11 start
# Reload config
gestures reload
# Preview service file (without installing)
gestures install-service --printNote: The display server (X11/Wayland) is automatically detected via WAYLAND_DISPLAY and XDG_SESSION_TYPE environment variables. Manual override is rarely needed.
This fork includes several performance improvements:
- Regex Caching: One-time compilation using
once_cell::Lazy - Thread Pool: 4-worker pool prevents PID exhaustion during fast gestures
- FPS Throttling: 60 FPS limit for Wayland (considering ydotool ~100ms latency)
- Timer-based Delays: Non-blocking mouse-up delays for smooth dragging
- Event Caching: 1-second cache for gesture configuration lookups
- Default 60 FPS throttle should keep CPU <5%
- Adjust in
src/event_handler.rsline 89 if needed
X11:
- Ensure
xdotoolis installed:which xdotool
Wayland:
- If your distribution package has issues, try the official ydotool binaries from GitHub releases
- Ensure
ydotoolddaemon is running:systemctl --user status ydotoold - Configure uinput permissions (see issue #4)
Disable built-in gestures in your desktop environment (GNOME, KDE, etc.)
- libinput-gestures - Parses debug output
- gebaar - Swipe only
- fusuma - Ruby-based