Gotcha: SXHKD doesn't like comments (in bindings)

I've written before about my usage of the BSPWM tiling window manager, which goes hand in hand with Simple X HotKey Daemon (SXHKD).

I noticed earlier that while trying to set a SXHKD binding, I suddenly stopped being able to trigger the creation of a window via the keybinding.

For instance, with the following binding:

super + shift + d
	# Next float via https://www.jvt.me/posts/2024/08/15/bspwm-next-float/
	bspc rule -a '*' -o state=floating; kitty

I was finding that SXHKD silently didn't respond to the keypress, nor could I see anything when running the sxhkd daemon interactively.

It appears that it was due to the location of the comment, and the following diff fixed it:

+# Next float via https://www.jvt.me/posts/2024/08/15/bspwm-next-float/
 super + shift + d
-	# Next float via https://www.jvt.me/posts/2024/08/15/bspwm-next-float/
 	bspc rule -a '*' -o state=floating; kitty

Once this was done, it was able to run correctly. This is another subtle reminder for me not to treat it as a shell script being executed!

Written by Jamie Tanna's profile image Jamie Tanna on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

This blog post is 100% human-written, and has nothing derived from LLMs (be it code, editorial support or prose).

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.