Rust implementation of the touchpad gesture daemon for KDE Plasma.
For MVP testing, run the daemon as your normal desktop user and grant temporary device access with test.sh.
This avoids permanent system changes such as udev rules or group membership changes.
./test.sh status./test.sh grantThis uses setfacl to grant your user read access to the detected /dev/input/event* device. If /dev/uinput exists, it also grants read/write access for arrow-key media mode.
Run the binary as your normal user, not with sudo:
cargo runOr:
./target/debug/asus-smartgesture-linux./test.sh revoke- The ACL changes are temporary and easy to undo with
./test.sh revoke. - If the touchpad device is recreated, you may need to run
./test.sh grantagain. test.shauto-detects the first input device whose name containstouchpad.
The daemon reads gesture configuration from ~/.config/asus-touchpad-gesture.toml. If the HOME environment variable is not set, the config path falls back to the current directory (./.config/asus-touchpad-gesture.toml). If the config file does not exist, the daemon uses built-in default values.
After modifying the configuration, don't forget to restart the service: systemctl --user restart asus-touchpad-gesture-rust.service
Example ~/.config/asus-touchpad-gesture.toml:
left_edge_threshold_percent = 0.1
right_edge_threshold_percent = 0.9
top_edge_threshold_percent = 0.1
sensitivity = 0.5
invert_y = false
volume_step = 0.05
brightness_step = 0.05
seek_step_microseconds = 10000000
media_control_mode = "mpris_seek"left_edge_threshold_percent: Fraction of touchpad width for left edge gesture activation (0.0 to 1.0)right_edge_threshold_percent: Fraction of touchpad width for right edge gesture activation (0.0 to 1.0)top_edge_threshold_percent: Fraction of touchpad height for top edge gesture activation (0.0 to 1.0)sensitivity: Gesture detection sensitivity (0.0 to 1.0)invert_y: Invert vertical gesture directionvolume_step: Volume change per gesture step (0.0 to 1.0)brightness_step: Brightness change per gesture step (0.0 to 1.0)seek_step_microseconds: Media seek step in microseconds (default: 10,000,000 = 10 seconds)media_control_mode: Media gesture backend, eithermpris_seekorarrow_keys(default:mpris_seek)
If the config file is missing, built-in defaults are used. If the file exists but contains invalid TOML or cannot be parsed, the daemon returns an error indicating the config path and failure reason.
The daemon supports media playback control via top-edge horizontal swipe gestures. By default it uses MPRIS seek calls when an MPRIS-compatible media player is running (e.g., Brave, Firefox, VLC, Spotify). Set media_control_mode = "arrow_keys" to emulate left/right arrow key taps instead.
- Swipe right on top edge: Seek forward by the configured step amount, or tap right arrow in arrow-key mode
- Swipe left on top edge: Seek backward by the configured step amount, or tap left arrow in arrow-key mode
- An MPRIS-compatible media player must be running
- Arrow-key mode requires read/write access to
/dev/uinput - Only single-finger gestures trigger media seek (multi-finger swipes are ignored)
- The gesture must start within the top edge zone (configurable via
top_edge_threshold_percent)
# Top 10% of touchpad height triggers media seek
top_edge_threshold_percent = 0.1
# Seek 10 seconds per gesture (10,000,000 microseconds)
seek_step_microseconds = 10000000
# Or emulate left/right arrow keys instead of MPRIS seek
media_control_mode = "arrow_keys"Install the Rust implementation as a systemd --user service with:
./install.shThis does all of the following:
- builds the release binary
- installs
~/.config/systemd/user/asus-touchpad-gesture-rust.service - copies the persistent udev rule to
/etc/udev/rules.d/71-touchpad-gestures.rules - enables
udevuaccessACLs for the active local desktop user
Start the service with:
systemctl --user start asus-touchpad-gesture-rust.serviceThis path does not require adding your user to the input group.
The generated user service is hardened with a read-only system view, a private /tmp, no privilege escalation, and Unix-socket-only IPC. It intentionally does not use PrivateDevices because the daemon must still read the touchpad event node under /dev/input.
Follow logs with:
journalctl --user -u asus-touchpad-gesture-rust.service -fRemove the user service with:
./uninstall.shThis removes the user service and deletes the installed udev rule.