[xmonad] Dynamic xmobar spawning

Ben Boeckel mathstuf at gmail.com
Wed Dec 14 04:25:59 CET 2011


Hi,

I'd like to get XMonad to spawn an xmobar for each monitor based on the
current number of montiors that are present. This includes spawning new
instances when monitors appear and tearing them down when they're taken
offline[1]. I've gotten most of the logic done (on a branch that I've
neglected to push from my work machines yet) and it involves some code
from adamvo's config[3] including getScreens, multiPP, and
mergePPOutputs which would indeed be good to get into contrib.

In my case, since I use xmonadpropwrite for xmobar so that a single
xmobar launch works independently of xmonad, it also requires a change
in xmobar itself to accept *supplemental* commands to run from the
command line. A branch with this support is on my github fork[4].

The last part is where I've hit a snag. I've tried to get some Xrandr
support into the X11 package, but my experience with the FFI is pretty
much nil and I've been unable to get something that looks/feels good
beyond what is already done in xmobar itself. There's also the question
of whether an X11-Xrandr package makes more sense (Xinerama is already
there, but xft isn't). I imagine xmobar would also pick up the code that
gets put into X11 or X11-Xrandr for its Xrandr needs instead of its own
bindings if/when that happens.

Thoughts?

--Ben

[1]Ideally, this could be toggled so that xmobar doesn't appear when it
isn't wanted (presentations come to mind). X.H.ToggleHook[2] could probably
help there.
[2]http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-ToggleHook.html
[3]http://haskell.org/haskellwiki/Xmonad/Config_archive/adamvo%27s_xmonad.hs
[4]https://github.com/mathstuf/xmobar/tree/dev/add-incremental-config-option
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20111213/ec735af9/attachment.pgp>


More information about the xmonad mailing list