[xmonad] xmobar

Norbert Zeh nzeh at cs.dal.ca
Wed Nov 16 16:49:32 CET 2011

Brandon Allbery [2011.11.16 1032 -0500]:
> On Wed, Nov 16, 2011 at 10:12, Marco Guidetti <marco at marcoguidetti.org> wrote:
>     > Why not just spawn all your xmobar instances whith spawnPipe, and then
>     just
>     > not using the pipe? This should properly restart all the instances when
>     > restarting xmonad. Or would the pipe be garbage collected too early?
>     I did try this way, but it doesn't work. I tried it again after
>     receiving your mail, and... it still doesn't work :)
>     Even if I use spawnPipe and I call it someway... something like
>     myUncleJoe <- spawnPipe "xmobar ~/.xmobardownrc"
>     it still doesn't work: once I hit mod+q the number of instances of
>     running xmobar increases.
> It's getting EOF from the closed pipe that triggers xmobar to exit.  If xmobar
> isn't reading from the pipe, it won't notice the EOF.
> You could still do it, just use a dummy StdinReader and write a single newline
> down the pipe after opening it.
>     bottomBar <- spawnPipe "xmobar ~/.xmobardownrc"
>     hPutStrLn bottomBar ""
> (Since it's an empty line, the StdinReader won't take up any actual space.)

I suppose the output to the pipe is so the StdinReader does not display
"Updating...", right?  Would it actually be possible to tell xmobar to run the
StdinReader but exclude it from its top-level output template?  In that case, it
doesn't matter what is sent to the StdinReader - it would never be displayed.
What I'm not sure about is whether xmobar would actually run the StdinReader and
see the EOF.  (I don't think xmobar checks whether a monitor is in the output
template before starting the monitor.)


More information about the xmonad mailing list