HK(1)

NAME
hk - Set temporary X11 hotkeys

SYNOPSIS
hk [-v -w] hotkey command [argument ...]

DESCRIPTION
hk allows temporary X11 hotkeys to be set. For example:

    hk Ctrl+Shift+F6 notify-send Hello

will execute the command “notify-send Hello” when “Ctrl+Shift+F6” is pressed. hk exits as soon as the command has executed.

The options are as follows:

-v  Once the hotkey is released, prints at regular intervals to stdout which non-ignored keys (see the CAVEATS section) remain held. Only meaningful in conjunction with -w.

-w  causes hk to wait until all non-ignored (see the CAVEATS section) keys (not just the hotkey) are released before executing command.

hotkey
    Is the hotkey to active the execution of command. Hotkeys take the form:

        [Modifier1[+Modifier2[+...]]+]<Key>

    The particular modifiers available depend on XKB's interpretation of your physical keyboard, but typically include Ctrl / Control, Shift, and so on. Modifiers are case insensitive. key is case sensitive and again depends on XKB 's interpretation of your physical keyboard. If in doubt, xev(1) can be used to find out the XKB name of a physical key.

command [arguments ...]
    is the program to be executed, using the outer shell's normal lookup mechanism to locate command. hk passes stdin, stdout, and stderr unchanged to command.

SEE ALSO
xev(1)

https://tratt.net/laurie/src/hk/

AUTHORS
-nosplit hk was written by Laurence Tratt <https://tratt.net/laurie/>

CAVEATS
hk ignores the Caps Lock, Mode Switch, Num Lock, and Scroll Lock modifiers when: determining if hotkey has been pressed; and determining whether any keys remain pressed for -w. However, other keyboard modifiers (which you may or may not be aware of!) can prevent hotkey being triggered.