← 返回命令列表

Linux command

sxhkd 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Start sxhkd

sxhkd &

Start with a custom configuration

sxhkd -c [~/.config/sxhkd/custom_sxhkdrc] &

Start with status output

sxhkd -s [/tmp/sxhkd.fifo] &

Redirect command output

sxhkd -r [/tmp/sxhkd.log] &

Reload configuration

pkill -USR1 sxhkd

Toggle hotkey grabbing

pkill -USR2 sxhkd

Set chord chain timeout

sxhkd -t 3 &

说明

sxhkd (Simple X Hotkey Daemon) listens for keyboard and mouse events on X11 and executes commands defined in its configuration file. It is window manager agnostic and commonly used with tiling window managers like bspwm. Configuration is read from ~/.config/sxhkd/sxhkdrc by default. Each binding consists of a hotkey line followed by a command line (indented with whitespace). Modifiers include super, alt, ctrl, shift, and mod1-mod5. Key features include chorded bindings (sequences like super + a ; b), key release events (prefix keysym with @), and pointer buttons (button1-button24). Sequences with {a,b,c} expand to multiple bindings. Commands execute via $SXHKD_SHELL or $SHELL. Send SIGUSR1 to reload configuration and SIGUSR2 to toggle hotkey grabbing.

参数

-h
Display help and exit
-v
Display version and exit
-c _config_file_
Read configuration from specified file instead of default
-r _redir_file_
Redirect command output to specified file
-s _status_fifo_
Write status information to specified FIFO
-t _timeout_
Chord chain timeout in seconds
-m _count_
Handle first count mapping notify events (for keyboard layout changes)

FAQ

What is the sxhkd command used for?

sxhkd (Simple X Hotkey Daemon) listens for keyboard and mouse events on X11 and executes commands defined in its configuration file. It is window manager agnostic and commonly used with tiling window managers like bspwm. Configuration is read from ~/.config/sxhkd/sxhkdrc by default. Each binding consists of a hotkey line followed by a command line (indented with whitespace). Modifiers include super, alt, ctrl, shift, and mod1-mod5. Key features include chorded bindings (sequences like super + a ; b), key release events (prefix keysym with @), and pointer buttons (button1-button24). Sequences with {a,b,c} expand to multiple bindings. Commands execute via $SXHKD_SHELL or $SHELL. Send SIGUSR1 to reload configuration and SIGUSR2 to toggle hotkey grabbing.

How do I run a basic sxhkd example?

Run `sxhkd &` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -h do in sxhkd?

Display help and exit