
I am trying to make dzen play nicely with xmonad and have run into a number of unpleasant issues. I tried to set up dzen according to this webpage, http://tombuntu.com/index.php/2009/03/19/adding-a-dzen2-statusbar-to-xmonad/ That more or less works, however I want to run a second dzen process so that I can view a clock and perhaps create a button or two for some other tasks. Initially my xmonad startup shell script (called via xsessions) looked like this: #!/bin/sh xmonad-clock | dzen2 -ta left -fg green -tw 500 -e "button1=exec:xterm" & xmonad | dzen2 -ta center where xmonad-clock writes out the time periodically (every 5 seconds or so). The button was just an attempt to play around with dzen. Unfortunately this doesn't work, the clock never gets displayed. If I run that command from a bash shell, after xmodem has launched, it works fine. I finally ended up putting the clock command piped to dzen (2nd line above) in .xinitrc. This approach does display the clock but the button doesn't work. All of these approaches have the additional annoying problem that when I try to quit xmonad via alt-shift-q, xmonad essentally hangs, or more likely it quits leaving no windows manager and no way to do anything but reboot. I have to make sure that dzen and xmonad-clock have been killed prior to quitting xmonad. I am running xmonad on a 64 bit build of arch-linux. What is causing this behavior, and is there any way I can get dzen or multiple copies of dzen to behave the way I want? I think I need at least two copies since the clock has to be updated periodically, wheras the output piped to dzen from xmonad is only sent during state updates.

Matthew wrote:
I am trying to make dzen play nicely with xmonad and have run into a number of unpleasant issues.
I tried to set up dzen according to this webpage, http://tombuntu.com/index.php/2009/03/19/adding-a-dzen2-statusbar-to-xmonad/
That more or less works, however I want to run a second dzen process so that I can view a clock and perhaps create a button or two for some other tasks.
For what it's worth, I do something similar, running three dzen2 bars with one displaying stuff piped from XMonad, one displaying various bits of system information, and a third one displaying a clock with a pop-up calendar. I start all three from xmonad.hs, and set things up so that they're killed and restarted when I restart XMonad (so that I can make changes to the bash scripts that drive the second two dzen2 bars, and hit M-q to run the updated versions). Here are the relevant parts of my xmonad.hs (I'm pretty new to XMonad, so if any gurus spot ways this could be done more elegantly, please let me know!). The "dzen-status-bar" and "dzen-cal" scripts position and size their respective dzen2 bars so that all three bars are lined up next to each other, with no overlap and no gaps. **************************** import Control.Concurrent (threadDelay) -- dzen bars myXmonadBar = "dzen2 -ta l -tw 550 -h 16 -fg '#aaa' -bg black -e ''" myStatusBar = "~/bin/dzen-status-bar" myCalendarBar = "~/bin/dzen-cal" myKillAllBars = "killall dzen2 dzen-status-bar dzen-cal" -- dynamic log hook myDynamicLogHook h = dynamicLogWithPP $ defaultPP { ... } -- main main = do spawn myKillAllBars threadDelay 1000 spawn myStatusBarmain = do spawn myKillAllBars threadDelay 1000 spawn myStatusBar spawn myCalendarBar dzen <- spawnPipe myXmonadBar xmonad $ defaultConfig { ... , logHook = myDynamicLogHook (dzen) >> myLogHook ... } **************************** (If anyone's interested in the "dzen-status-bar" and "dzen-cal" scripts, let me know and I'll send them to you. I intend to make them available along with my xmonad.hs eventually, but don't have time to do it right now.) Hope that helps, Toby

On Fri, 24 Jul 2009 11:18:47 +0200
Toby Cubitt
... (If anyone's interested in the "dzen-status-bar" and "dzen-cal" scripts, let me know and I'll send them to you. I intend to make them available along with my xmonad.hs eventually, but don't have time to do it right now.) ...
Of course, it would be nice to see them. I have my own scripts either, but they are not perfect ;) Cheers, Sergey

Sergey Manucharian wrote:
On Fri, 24 Jul 2009 11:18:47 +0200 Toby Cubitt
wrote: ... (If anyone's interested in the "dzen-status-bar" and "dzen-cal" scripts, let me know and I'll send them to you. I intend to make them available along with my xmonad.hs eventually, but don't have time to do it right now.) ...
Of course, it would be nice to see them. I have my own scripts either, but they are not perfect ;)
Well, since you asked... I've put them online at www.dr-qubit.org/code/scripts/dzen-status-bar and www.dr-qubit.org/code/scripts/dzen-cal I still update them from time to time, so I'll try to remember to upload any updates to the same place. I might as well leave them up there until I get around to posting them somewhere more sensible (e.g. the XMonad config archive). You can configure the bars by editing the variables at the top of the scripts, and (in dzen-status-bar) by commenting in/out lines in the main loop, right at the bottom. Not the most user-friendly, but not too difficult. I only wrote them for my own use, and I would probably need to massage them into shape a little if I ever released them "officially". Enjoy! Toby

On Fri, 24 Jul 2009 18:23:04 +0200
Toby Cubitt
... I've put them online at
www.dr-qubit.org/code/scripts/dzen-status-bar
and
www.dr-qubit.org/code/scripts/dzen-cal
I still update them from time to time, so I'll try to remember to upload any updates to the same place. I might as well leave them up there until I get around to posting them somewhere more sensible (e.g. the XMonad config archive).
You can configure the bars by editing the variables at the top of the scripts, and (in dzen-status-bar) by commenting in/out lines in the main loop, right at the bottom. Not the most user-friendly, but not too difficult. I only wrote them for my own use, and I would probably need to massage them into shape a little if I ever released them "officially". ...
Thank you, Toby! Cool scripts! What I did - instead of using one status bar script I made many small ones - kind of modular approach: cpu, battery, memory, weather, volume etc. Of course, in that case it's harder to manage their positions. And my calendar script is very similar to yours but, shows a horizontal calendar ;) All of them are not polished though, but if somebody would like to see them I'll share with pleasure. Cheers, Sergey

Are you sure the dzen windows doesn't simply overlap each other? Try to append "-x 500" to "xmonad | dzen2 -ta center". Your X session ends when the session script (~/.xsession for me) terminates. Quitting xmonad, doesn't do anything special but to terminate the xmonad process. You can use pstree to find out which process prevents the session script from ending: ... |-xdm-+-X | `-xdm---.xsession---xmonad-i386-lin ... Regards, Mads On Fri, Jul 24, 2009 at 03:13:45AM -0400, Matthew wrote:
I am trying to make dzen play nicely with xmonad and have run into a number of unpleasant issues.
I tried to set up dzen according to this webpage, http://tombuntu.com/index.php/2009/03/19/adding-a-dzen2-statusbar-to-xmonad/
That more or less works, however I want to run a second dzen process so that I can view a clock and perhaps create a button or two for some other tasks. Initially my xmonad startup shell script (called via xsessions) looked like this:
#!/bin/sh xmonad-clock | dzen2 -ta left -fg green -tw 500 -e "button1=exec:xterm" & xmonad | dzen2 -ta center
where xmonad-clock writes out the time periodically (every 5 seconds or so). The button was just an attempt to play around with dzen. Unfortunately this doesn't work, the clock never gets displayed. If I run that command from a bash shell, after xmodem has launched, it works fine.
I finally ended up putting the clock command piped to dzen (2nd line above) in .xinitrc. This approach does display the clock but the button doesn't work.
All of these approaches have the additional annoying problem that when I try to quit xmonad via alt-shift-q, xmonad essentally hangs, or more likely it quits leaving no windows manager and no way to do anything but reboot. I have to make sure that dzen and xmonad-clock have been killed prior to quitting xmonad.
I am running xmonad on a 64 bit build of arch-linux. What is causing this behavior, and is there any way I can get dzen or multiple copies of dzen to behave the way I want? I think I need at least two copies since the clock has to be updated periodically, wheras the output piped to dzen from xmonad is only sent during state updates. _______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (4)
-
Mads N Noe
-
Matthew
-
Sergey Manucharian
-
Toby Cubitt