Sxhkd, the best utility for a tiling window manager
make your own keyboard shortcuts, anywhere
Date: 2025-09-25
When it comes to tiling window managers on Linux, I consider sxhkd to be one of the best - if not the best - utility. It's a hotkey daemon, that you can use independently from any window manager, to setup keyboard shortcuts, in almost any way you see fit.
Originally it was made by the developer of Bspwm (a very nice twm), for his system. But it can be used for any window manager or DE.
How to install and setup sxhkd?
Usually you can find it in your distro's package manager with the same name. If for some reason, you want to compile it from source, you can do it downloading it via github. After installation, you have to setup the config file, which is usually in:
~/.config/sxhkd/sxhkdrc
This is how you add in autostart, or in your ~/.xinitrc file, so it does start when you log into your system.
sxhkd -c $HOME/.config/sxhkd/sxhkdrc
The path of course can be anywhere that your user has permission. With this you can use different configs for different window managers or DEs. I have my full on Bspwm setup with tons of sxhkd config, but then I use it for Herbstluftwm as well with some shortcuts. I prefer to put it into the same directory, but use a different name, so when I need to edit it, I can find it, as I use the phrase "herbs" for most of the config related to herbstluftwm.
There are a couple of examples on github, that serve as a good introduction, how you can use sxhkd.
Why I like sxhkd?
I love using Emacs, and one of the best feature of it, is the chained keyboard shortcuts or keychords. It means that you can setup a keyboard chain to launch a program, or reach a function.
My example:
I have multiple browsers installed, and I use almost all of them for one thing or another. Instead of giving each of them a unique shortcut, I made sure to have a simple umbrella command, where I can reach all of them.
This is Mod+Shift+b then I have my browsers ready, like this:
- b for Brave
- e for Zen
- v for Vivaldi
- n for Nyxt
etc.
So in order to launch Brave, I press Mod+Shift+b, release it, then I press b for Brave.
In the config this looks like this:
super + shift + b ; {b,e,v,n} {brave-browser-stable,zen-browser,vivaldi-stable,nyxt}
We can see that a semicolon is acting as sort of wall between groups of keys here, and in the second row we can define, what those keys do.
As far as I know there is no limit, how much shortcut you can chain together, however for obvious human memory reasons, shorter is better.
The system doesn't rely on your Mod key, so you can freely use Control, Alt, Shift as long as they don't have conflicts with other keys not just within sxhkd, but with your tiling window manager either.
In order to more easily edit the config file, there is syntax support for Emacs, vim and VS Code.