Ahti Kitsik
Building develper tools. Python, Java, JavaScript.

writings about @ahtik

xmobar and "could not execute command" error

By Ahti Kitsik, 05 Jul 2014

xmobar is a powerful yet minimalistic status bar for xmonad. Not that there's ever been anything non-minimalistic in the xmonad land but whatever.

Anyways, this post is a reference point to myself and fellow googlers who get "Could not execute command" error while trying to tweak xmobar to have a volume indicator or any other command running using "Run Com" in xmobarrc.

Long story short, it's possible that your Run Com references "~" as part of the path or anything else that is expected to be expanded. Solution:

Run Com "/bin/bash" ["-c", "~/path/to/your/script"]

... or... just expand "~" to /home/ahtik/

The longer uncut story: a change in xmobar (dated 2013) made the command running more secure by switching from runInteractiveCommand to runInteractivePRocess. See #127 at Github

Cheers! Stay strong.

@ahtik is on twitter!