Dynamic xmobar spawning

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

On Tue, Dec 13, 2011 at 22:25, Ben Boeckel
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.
There's already an X11-xft package (which includes Render (not RandR) support; I'm not sure if that belongs there). As to RandR, my inclination is that it should be part of X11, not a separate package — as long as the package continues to work in the absence of RandR. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Tue, Dec 13, 2011 at 10:25 PM, Ben Boeckel
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.
Good to see those parts of my config are useful. I think those functions didn't end up in contrib since at the time I wasn't sure if those definitions could be improved by either (1) being simpler to use or (2) being less restrictive. I believe Tomas Janousek also has something similar in his configuration, though I don't recall where to find it. Cheers, Adam

* On Friday, December 16 2011, adam vogt wrote:
On Tue, Dec 13, 2011 at 10:25 PM, Ben Boeckel
wrote: 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.
Good to see those parts of my config are useful. I think those functions didn't end up in contrib since at the time I wasn't sure if those definitions could be improved by either (1) being simpler to use or (2) being less restrictive.
I believe Tomas Janousek also has something similar in his configuration, though I don't recall where to find it.
This seems to be it: https://github.com/liskin/liskin-xmonad-conf -- Adam
participants (3)
-
adam vogt
-
Ben Boeckel
-
Brandon Allbery