SxhkdRofi is a program that parses your sxhkdrc
file, used with bspwm to define keybindings, and displays them using Rofi.
I created this because there are a lot of keybindings to know when using bspwm, and having to open the sxhkdrc
file everytime you want to find a keybinding can get annoying.
At the moment of writing this, prebuilt binaries are not available.
You can compile this yourself using meson
.
- rofi
- meson
- libglib2.0
You can install these on Debian based systems with apt
:
apt install rofi meson libglib2.0-dev
git clone https://github.com/Discusser/SxhkdRofi.git && cd SxhkdRofi
meson setup builddir && cd builddir
meson compile
cp SxhkdRofi ~/.local/bin/ # You can copy this anywhere in your PATH and it'll work
SxhkdRofi outputs keybindings to the terminal to be used with Rofi. You can achieve this with the following command:
rofi -modi 'sxhkd:SxhkdRofi' -show sxhkd
I recommend the following command to make it a bit prettier. You can change the value of theme
and theme-str
to your liking, but that's just how I've configured it.
rofi -modi "sxhkd:SxhkdRofi -a" -show sxhkd -theme $HOME/.config/rofi/applets/type-1/style-1.rasi -theme-str 'window { width: 50%; height: 50%; }'
The command above creates a menu that looks something like this:
If your sxhkdrc
file is not located in the directories SxhkdRofi searches in (see below), you can specify it by passing the -f
or --file=
flag to SxhkdRofi
:
rofi -modi 'sxhkd:SxhkdRofi -f /path/to/sxhkdrc' -show sxhkd
Usage:
SxhkdRofi [OPTION?]
Help Options:
-h, --help Show help options
Application Options:
-f, --file=/path/to/sxhkdrc The path to the sxhkdrc file containing the keybindings. Default: $HOME/.config/sxhkd/sxhkdrc or $XDG_CONFIG_HOME/sxhkd/sxhkdrc
-a, --align-entries=true Whether or not entries should be aligned on the semicolon (with right padding). Default: false