HK(1) General Commands Manual HK(1)

hkSet temporary X11 hotkeys

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

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:

causes hk to wait until keys (not just the hotkey) are released before executing command.
Is the hotkey to active the execution of command. Hotkeys take the form:

The particular modifiers available depend on XKB's interpretation of your physical keyboard, but typically include / , , and so on. Modifiers are case insensitive. 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.

hk ignores the Caps Lock and Num Lock modifiers when determining if hotkey has been pressed, but other keyboard modifiers (which you may or may not be aware of!) can prevent hotkey being triggered.


hk was written by Laurence Tratt ⟨⟩

December 12, 2021 OpenBSD 7.0