Compiling xmobar or taffybar into xmonad

Hi all, I'm curious if anybody has compiled xmobar or taffybar into their actual actual xmonad. Is this a crazy idea? Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On Sun, Jan 12, 2014 at 11:48 PM, Erik de Castro Lopo
I'm curious if anybody has compiled xmobar or taffybar into their actual actual xmonad. Is this a crazy idea?
It's a very bad idea without rearchitecting xmonad's main loop to allow it to support anything other than X11 events. In particular, you really want timed events for a status bar, and at present the only way to get that while maintaining access to xmonad's internal state is to have a separate thread periodically sendMessage X11 events to the main thread. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Brandon Allbery wrote:
It's a very bad idea without rearchitecting xmonad's main loop to allow it to support anything other than X11 events. In particular, you really want timed events for a status bar, and at present the only way to get that while maintaining access to xmonad's internal state is to have a separate thread periodically sendMessage X11 events to the main thread.
Oh wow, I wasn't going to do anything clever, I was just going to forkIO what would normally have been the main function of taffybar. Taffybar already runs happily in its own process without access to xmonad's internal state, so all it would be doing is using the exising communication protocols and sharing the RTS. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Erik de Castro Lopo
Brandon Allbery wrote:
It's a very bad idea without rearchitecting xmonad's main loop to allow it to support anything other than X11 events. In particular, you really want timed events for a status bar, and at present the only way to get that while maintaining access to xmonad's internal state is to have a separate thread periodically sendMessage X11 events to the main thread.
Oh wow, I wasn't going to do anything clever, I was just going to forkIO what would normally have been the main function of taffybar.
Taffybar already runs happily in its own process without access to xmonad's internal state, so all it would be doing is using the exising communication protocols and sharing the RTS.
Xlib wasn't reentrant last time I checked, so you'll end up with tons of race conditions. -- \ Troels /\ Henriksen

Troels Henriksen wrote:
Xlib wasn't reentrant last time I checked, so you'll end up with tons of race conditions.
Interestingly, doing what I proposed resulted in an Xmonad where taffybar did not work at all. Rather than try and debug it, I will just blame a non-re-entrant Xlib :-). Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On Mon, Jan 13, 2014 at 2:07 AM, Erik de Castro Lopo
It's a very bad idea without rearchitecting xmonad's main loop to allow it to support anything other than X11 events. In particular, you really want timed events for a status bar, and at present the only way to get that while maintaining access to xmonad's internal state is to have a separate thread periodically sendMessage X11 events to the main thread.
Taffybar already runs happily in its own process without access to xmonad's internal state, so all it would be doing is using the exising communication protocols and sharing the RTS.
As already noted, Xlib isn't reentrant so this would not work anyway, even if you gave the taffybar thread its own server connection (which would be necessary in any case). There *is* a function that enables Xlib use in a threaded environment, but it works by effectively wrapping all Xlib calls in a big mutex so performance pretty well tanks. In short, it's not worth it. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Hi. You can take a look at xmobar-usable https://github.com/dmalikov/xmobar-usable, it is outdated fork of xmobar with ability to have xmobarrc as a pure haskell code. Is that what you want? I.e. here is xmobar.hs https://github.com/dmalikov/dotfiles/blob/master/configs/xmonad/xmobar.hs that use Application module exported by xmobar-usable. On 01/13/2014 08:48 AM, Erik de Castro Lopo wrote:
Hi all,
I'm curious if anybody has compiled xmobar or taffybar into their actual actual xmonad. Is this a crazy idea?
Cheers, Erik
-- Best regards, dmitry malikov !
participants (4)
-
Brandon Allbery
-
Dmitry Malikov
-
Erik de Castro Lopo
-
Troels Henriksen