← Back to Documentation

About touchy

The background, design philosophy, and technical implementation behind touchy.

The Problem

Laptop touchpads on modern Linux setups often suffer from erratic palm-detection behavior. While typing on modern Wayland compositors like Hyprland, palms casually graze the touchpad surface, triggering accidental cursor jumps, unintended focus stealing, or stray clicks in text editors and terminals.

Built-in compositor palm detection can be finicky or laggy, and standard generic tools don't always integrate cleanly with Hyprland's dynamic device IPC.

The Solution

Created by Joshua Edward McLaughlin Cox (Tekromancy), touchy provides an ultra-lightweight, reactive daemon that listens directly to hardware input events.

By piping libinput debug-events looking specifically for KEYBOARD_.*pressed signals, touchy immediately invokes Hyprland's IPC command hyprctl keyword device[<device>]:enabled false to lock the touchpad instantly.

As soon as keypress activity stops, a lightweight configurable debounce timer (defaults to 1 second) cleanly re-enables the touchpad, ensuring seamless typing without frustration.

Key Highlights

Direct Hardware Event Stream

Uses libinput's raw stream so key detection happens instantaneously before the window manager or compositor layers add latency.

Gamer Friendly

Supports semaphore flags (/tmp/.game_mode_on) so gaming sessions with simultaneous WASD keys and touchpad aiming aren't interrupted.

Config Cascading

Reads settings from ~/.touchyrc or ~/.config/touchy/touchyrc, plus environment variable overrides.

Singleton Protection

Includes automated lockfile checks preventing multiple instances from fighting over hyprctl state changes.

Source Code & Community

touchy is free and open-source software licensed under GPL-3.0. Pull requests and feature requests are welcome to expand compositor support to Sway, River, or Niri.

github.com/Tekromancy/touchy