[xmonad] xmobar

Marco Guidetti marco at marcoguidetti.org
Wed Nov 16 16:12:42 CET 2011


thank you both for your responses.
I will try to answer in-mail.

On Wed, Nov 16, 2011 at 3:22 PM, Audun Skaugen <audunskaugen at gmail.com> wrote:
> Norbert Zeh wrote:
>> I ran into the same problem.  The way I see it, the problem is that xmonad
>> does
>> not keep track of the processes it spawns.  Thus, when restarting, these
>> processes stay around.  The reason why I think this does not happen with
>> the
>> xmobar spawned as a pipe to receive xmonad's log output is that the xmobar
>> instance dies the moment the pipe gets closed by xmonad.
>> The way I work around this (I'm running 4 xmobar instances ;) and some
>> other
>> things in my X11 session) is to wrap the invocation of xmonad into a
>> session
>> script that starts all the things I want.  Then restarting xmonad does not
>> trigger rerunning the session script and all is well.  The only situation
>> where
>> I'm not happy with this solution is when I reconfigure the xmobar
>> instances
>> themselves because they still won't restart when restarting xmonad.  In
>> this
>> case, I kill them and restart them by hand.

I tried this,  but the biggest problem (for me) was to be able to
distinguish between different instances of xmobar running.
I solved it with (in the startup shell script):

xmobardown=`ps ax |grep xmobar|grep -v up|awk '{print $1}'`
for proc in ${xmobardown}
  kill -9 ${proc}
xmobar ~/.xmobardownrc &

I am sure there is a more elegant way to do it, maybe using pidof (it
didn't work for me tho) but this works, more or less.
You say you use 4 instances of xmobar? Can I put xmobar also in
"vertical"? That would be nice ;)

> 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.

Next issue is the tray: I am using trayer (for things like nm, volume
applet, since multimedia keys on this lenovo laptop do not return
anything xev is happy to tell you about even tho they used to work
with gnome/kde).
Are there other options the list knows of?



More information about the xmonad mailing list