Skip to main content

install_bind

Function install_bind 

Source
pub fn install_bind(chord: &Chord, action: &str) -> Result<(), HotkeyError>
Expand description

Install the Hyprland inline keybind for the given chord, tagged with an action label (“word”, “sentence”, “review”, …).

The bind’s exec writes the action label to the runtime action file and then kill -USR1s the daemon — the daemon reads the label in its trigger handler to pick which fix to run. Hyprland’s exec already wraps the command in sh -c, so shell substitution (>, &&, $(...)) works without extra quoting.

Idempotent: first runs hyprctl keyword unbind for the same chord so a previous (uncleanly-shut-down) daemon’s bind doesn’t leave duplicates behind.

§Errors

See HotkeyError.