haskellxmonadxmobar

Clickable XMobar works... but crashes XMobar. What is the modern approach I should follow to have anything I want clickable in XMobar?


(I wrote "clickable XMobar" rather than "clickable workspaces" because eventually I want other plugins to be clickable too.)

tl;dr

Defining

foo = wrap "<action=`touch ~/foo` button=1>" "</action>"

or equivalently

foo = xmobarAction "touch ~/foo" "1"

and composing it with ppCurrent of xmobar's PP

myXmobarPP :: PP
myXmobarPP = def { ppCurrent = foo . ppCurrent def }

results in touch ~/foo being indeed executed when clicking on the current workspace's tag, but it also causes xmobar to be killed.

More datails

Gathering various information,

I gave a few tries, and these two below are alternative approaches that resulted in a partial success:

In either case, clicking on a workspace does move to that workspace... but also kills the xmobar process.

I've also tried re-launching xmobar manually from the terminal to see if some error would help me understand

xmobar --verbose

but the error I see when it gets killed is just xmobar: waitForProcess: does not exist (No child processes)


Below are the minimal config files (plus non-minimal things you might want to edit to what you're used to, e.g. modMask):


Another attempt:

The above still has the same effect that upon click on a hidden workspace brings me to it (good), but kills xmobar (bad).


Solution

  • Apparently there was a bug in XMobar, which was promptly fixed by the author.

    For details, see comments in my original bug report and the following.