mxhkd is an X daemon that reacts to input events by executing commands.
It's like sxhkd but it's modal rather than using chords.
Initially the idea was to write a full compositor that would be modal.
Kind of like i3
but modal. That proved to be too hard and it was
obviously going to take months. Instead this was cranked out in a few
days.
Key chords like those used in sxhkd and many other programs can contribute to RSI. Using modes is a great way to reuse the keys closest to the natural positioning of your hands.
Read up on the emacs pinky this doesn't make any sense to you.
The initial intention was to do modal control of the windowing.
That turned into running arbitrary commands, and use any window
manager you want. bspwm
might be a natural fit to use with mxhkd,
but also something like herbstluftwm
. Up to you. Testing was mostly
done with i3
and that worked fine as well.
Docs can be found here.
See the examples
folder.
If it's installed:
mxhkd --config /path/to/config.toml
There's a runtime dependency in xmodmap
. This will be removed
in the near future. It's used at startup to determine the key code
to character layout.
Clone this repo, go to the root folder, and then run
nix-shell --command "cargo run -- --config examples/mxhkd_config.toml"
Have a look at the shell.nix
file to see which system
dependencies are needed.
mxhkd takes over your main X window, so it might not be compatible with
any other system that intends to do the same. In normal Window
mode, it
simply listens on the whichever mode toggle key has been configured, and
passes through the rest of the keystrokes to whichever other program is
listening to commands. So technically it shouldn't interfere with many
things. In Normal
mode it listens to your entire keyboard, as you
would expect.
The xmodmap
dependency might not work as expected depending on the keyboard.
Please open an issue if something completely wrong happens.
This thing is totally hacked.
Use at your own risk!
Happy to receive PRs.
- Carlos D'Agostino (@carlosdagos)
- Robert McMichael (@robbiemcmichael)