
Quoting Marco Guidetti
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} do kill -9 ${proc} done 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 ;)
Seems pretty complicated. Why not kill all the xmobars? xmonad is about to restart them anyway. Stick something like this above your 'spawn "xmobar -blahblah"' in xmonad.hs: spawn "killall xmobar" ~d