Linux · System Tools
sxhkd
sxhkd is a simple X11 hotkey daemon that lets you define keyboard shortcuts in a config file to control window behavior and launch commands.
- License
- MIT
- Latest version
- 0.6.3
What is sxhkd?
sxhkd (Simple X HotKey Daemon) runs in the background on X11 systems and binds key combinations to shell commands. It’s minimal by design, with no GUI—just a text config file. Developed alongside tiling window managers like bspwm, it’s mature and stable, widely available in major distros.
It’s for users who want full control over their desktop shortcuts without bloat. If you're comfortable editing config files and scripting, sxhkd fits right into a DIY Linux workflow. Not for casual users; it’s aimed at tiling WM users or those building minimal desktops from scratch.
Compared to Microsoft PowerToys, sxhkd feels barebones. PowerToys offers GUI tools, fancy zones, and accessibility features. sxhkd does one thing: run commands on keypress. But it’s more flexible for keyboard-driven workflows, especially with tiling WMs. It’s not a direct replacement—it’s a different philosophy.
Best for: Users who want lightweight, scriptable keyboard shortcuts in a minimal X11 desktop environment.
Key features of sxhkd
- Define custom keyboard shortcuts in a plain-text config file
- Supports modifier keys (Ctrl, Alt, Super) and combinations
- Reloads config without restarting
- Lightweight and fast, minimal resource use
- Designed to work with tiling window managers like bspwm
- Supports complex key sequences and chained commands
- Runs as a background daemon (no system tray or GUI)
Pros
- Extremely lightweight and fast
- Highly customizable with simple syntax
- Integrates perfectly with minimal desktop setups
- No GUI overhead or dependencies
- Widely supported across distros and window managers
Cons
- No GUI—everything is config-file based
- Only works on X11, not Wayland
- Steeper learning curve for beginners
- No built-in shortcut editor or visual feedback
Windows programs sxhkd replaces
How to install sxhkd on Linux
sudo apt install sxhkdsudo apt install sxhkdsudo dnf install sxhkdsudo pacman -S sxhkdsudo zypper install sxhkdTips for Windows users
If you're used to PowerToys, forget drag-and-drop tools. sxhkd uses ~/.config/sxhkd/sxhkdrc—a plain text file where you write key combos and shell commands. No import/export; you edit manually. Workflow is more hands-on: edit, reload (killall -USR1 sxhkd), test. It’s less visual but more scriptable and precise once set up.
sxhkd: frequently asked questions
Does sxhkd work with Wayland?
No, sxhkd only works on X11. For Wayland, consider using your compositor’s built-in keybinding support or tools like wob or sway bindings if using Sway.
Where is the sxhkd config file located?
Typically ~/.config/sxhkd/sxhkdrc. Create the directory and file if it doesn’t exist. Check your distro’s docs or sxhkd man page for defaults.
How do I reload sxhkd after changing the config?
Send a SIGUSR1 signal: killall -USR1 sxhkd. This reloads the config without restarting the daemon.
Can I use sxhkd with GNOME or KDE?
Technically yes, but it may conflict with built-in shortcuts. It’s best suited for minimal window managers like bspwm or i3 where you control all keybindings.
Updated