sxhkd icon indicating copy to clipboard operation
sxhkd copied to clipboard

Chord and chains can interfere without a warning

Open btolsch opened this issue 4 years ago • 0 comments

Having the same hotkey chord for two commands in your config file will silently add them both to the list of hotkeys but only ever match and run the first. This happened to me because I had a seldom-used window manager hotkey still enabled when I was trying to add a new binding and discovered it wasn't working. It would be nice if sxhkd warned about this condition instead of manually searching the config file, especially since things like super + {_,ctrl + } {x,y,z} make it a little harder to spot.

Furthermore, I noticed that chains have a similar problem. Consider these configs:

super + x
  notify-send X X
super + x ; super + c
  notify-send X C

and

super + x ; super + c
  notify-send X C
super + x
  notify-send X X

In the first file, the second bind won't work, but in the second file, both binds work. Furthermore, if you extend each chain with e.g. super + z, the longer one will never work.

Fixing this edge case is probably less useful, but it's also possible to warn about this condition.

btolsch avatar Aug 22 '20 23:08 btolsch