Skip to main content

Module hotkey

Module hotkey 

Source
Expand description

Global trigger via a Hyprland inline keybind + signals.

At startup the daemon adds an inline Hyprland keybind whose exec reads the daemon’s PID file and kill -USR1s that PID specifically. Hyprland intercepts the chord — terminals and other focused apps never see it — and the daemon catches the signal as HotkeyEvent::Trigger.

The PID-file-based targeting is deliberate: pkill -x hyprcorrect would match the prefs subprocess too (it shares the daemon’s binary name and therefore its /proc/PID/comm) and silently terminate the prefs window when the user pressed the chord. The file is written by the daemon at startup and removed on shutdown — see hyprcorrect_core::runtime.

SIGHUP arrives as HotkeyEvent::Reload and is the prefs window’s signal to the running daemon that the config has changed.

Hyprland-specific. The cross-compositor route is the GlobalShortcuts portal (DESIGN.md); that has its own auto-bind limitation on xdg-desktop-portal-hyprland today, so we’ll revisit it together with M3’s portable backends.

Enums§

HotkeyError
An error registering the Hyprland keybind or signal handler.
HotkeyEvent
A daemon-level event driven by the operating-system signal stream.

Functions§

install_bind
Install the Hyprland inline keybind for the given chord, tagged with an action label (“word”, “sentence”, “review”, …).
signal_channel
Start the signal listener.
uninstall_bind
Remove the Hyprland inline keybind for the given chord. Calling this for an unbound chord is silently fine.