Using sxhkd without clobbering config file

Issue #4 resolved
Jon Sagotsky created an issue

This is a nitpick.

I already use sxhkd. I quite like that dk encourages me to keep using it instead of adding its own way of handling keybidnings.

What I don’t like about that is that it suggests I add dk specific binds to my sxhkdrc. This means that if I switch back to xmonad or qtile, super + j won’t work until I go comment it out.

Anyway, sxhkd gives us an answer. It’s capable of reading in multiple config files and joining them together under a single instance. I put the following in my dkrc.

# launch wm specific keymaps
if hash sxhkd >/dev/null 2>&1; then
  config_dir=$(dirname "$0")
  pkill sxhkd
  sxhkd -c "$config_dir/sxhkdrc" "$HOME/.config/sxhkd/sxhkdrc" &
fi

Comments (3)

  1. Nate Maia repo owner

    This makes perfect sense to me but I'm not sure it's really a dk issue, we don't force an install of dk's sxhkdrc.

    I think this is a good idea and I'll update the dkrc. The intention is not to provide the most comprehensive config setup, just basics to get dk up and running with some same defaults. Users looking for more advanced setups can do something like this per their needs. Think of xinit, it doesn't include anything and you're just expected to scour around to find snippets or write your own to do any number of things when starting X.

    This is why I stuck with dkcmd and scripting for configuring/changing dk, you could write the rc file in whatever you like (shell, python, go, c, etc.) as long as it's executable and calls dkcmd.

  2. Log in to comment