✨ Wayland + Hyprland Touchpad Protection

Stop accidental palm taps on Hyprland

touchy streams hardware keyboard events through libinput and automatically disables the touchpad while you type. Zero lag, ultra-responsive, and gamer friendly.

$curl -sL https://raw.githubusercontent.com/tekromancy/touchy/refs/heads/main/bootstrap.sh | bash

Automated bootstrap or build via CMake in seconds.

Why Use touchy?

A specialized daemon designed to solve the annoying palm-brush problem on Linux laptops once and for all.

⚡

Instantaneous Kernel Stream

Streams raw keyboard events directly from libinput debug-events. Touchpad lockout triggers on the very first keypress without waiting for compositor event routing.

🎮

Integrated Game Mode

Playing an FPS or trackpad game? Simply touch a semaphore lock file (/tmp/.game_mode_on) and touchy gracefully suspends lockout behavior so your controls remain active.

🎛️

Full Configuration Cascading

Configure your device name, timeout debounce, notification verbosity, and log levels via ~/.touchyrc, ~/.config/touchy/touchyrc, or environment variables.

Installation

Choose between the one-line bootstrap installer or building from source using CMake:

Method 1: Fast Automated Bootstrap

Downloads the latest release archive, extracts, builds, and installs the binary and man pages to /usr/local/bin:

curl -sL https://raw.githubusercontent.com/tekromancy/touchy/refs/heads/main/bootstrap.sh | bash

Method 2: Manual Clone & CMake Build

Clone the repository, inspect the code, and install using the included CMake scripts:

git clone https://github.com/Tekromancy/touchy.git
cd touchy
cmake .
make
sudo make install

System Prerequisites

Requires hyprland (with hyprctl), libinput (with libinput-tools), and optional libnotify for notification toasts. Ensure your user belongs to the input group to read libinput debug-events.

Hyprland Autostart Integration

To start touchy automatically when Hyprland launches your session, add an exec-once directive to your Hyprland configuration:

~/.config/hypr/hyprland.conf (or autostart.conf)
# Enhanced touchpad disable-while-typing daemon
exec-once = /usr/local/bin/touchy

Configuration & Environment

touchy can be configured via environment variables or in an RC file located at ~/.touchyrc or ~/.config/touchy/touchyrc.

Finding Your Touchpad Device Name

Run hyprctl devices to list input devices detected by Hyprland, and look for your touchpad identifier:

hyprctl devices | grep -i touchpad -B 2 -A 5
VariableDefaultDescription
TOUCHPADasuf1209:00-2808:0219-touchpadTarget touchpad device identifier in hyprctl.
TOUCHY_DELAY1Debounce sleep time in seconds after typing ends before re-enabling trackpad.
GAME_MODE_SEMAFORE_FILE/tmp/.game_mode_onFile path indicating game mode is active (locks touchpad disabling).
TOUCHY_VERBOSITY1Console & notify-send verbosity level (higher = more logs & toast popups).
TOUCHY_LOGLEVEL0File log level for disk reporting in /tmp/.touchy.log.

Example ~/.touchyrc

# Touchpad device from 'hyprctl devices'
TOUCHPAD="synps/2-synaptics-touchpad"

# Delay in seconds to wait after last keypress
TOUCHY_DELAY=0.8

# Keep desktop quiet
TOUCHY_VERBOSITY=0

Game Mode Integration

When gaming on laptops, holding down movement keys (WASD) while aiming or clicking with the touchpad is essential. touchy checks for the presence of a semaphore file and bypasses lockout when enabled:

Enable Game Mode

Touch the semaphore file. The touchpad will stay active during keypresses:

touch /tmp/.game_mode_on

Disable Game Mode

Remove the semaphore file to resume normal disable-while-typing:

rm -f /tmp/.game_mode_on

Frequently Asked Questions

Why does libinput report permission denied?

Reading raw device events via libinput debug-events requires access to /dev/input/event*. Add your user to the input group via sudo usermod -a -G input $USER, then log out and back in.

Can I adapt touchy for Sway or River compositors?

Yes! The core event loop monitors libinput. Replacing the hyprctl keyword device[...] invocations with swaymsg input "<device>" events disabled is straightforward. Pull requests are welcomed!