[xmonad] xmonad, dzen, pipeline issues
Toby Cubitt
tsc25 at cantab.net
Fri Jul 24 05:18:47 EDT 2009
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
More information about the xmonad
mailing list