You are not logged in.

#1 2009-06-15 10:56:32

pedro-kun
Member
From: Portugal
Registered: 2007-07-20
Posts: 30

Multiple Dzens with XMonad

Hi there,

How can I start multiple dzen2 instances from xmonad in order to display info such as workspaces and window title in different dzens?

Here is the relevant bit of my xmonad.hs

main = do
  dzen <- spawnPipe varDzenCommandLine
  xmonad $ defaultConfig
    {
      -- ...
      , logHook = dynamicLogWithPP $ myDzenPP dzen
      -- ...
    }

myDzenPP h = defaultPP
  {
    -- ...
  }

What I want is to have, for example, one dzen receiving workspace names and another receiving the Window Title

Thanks in advance

Offline

#2 2009-06-15 11:47:50

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Multiple Dzens with XMonad

This is possible but I don't know of an off the shelf solution. Of course there may be one that I'm not aware of. smile

What I would do is pipe xmonad's output into a python script that reads the input and breaks it up into it's various items and then outputs them to multiple spawned dzen's. Use subprocess.Popen to spawn the dzens.

Offline

#3 2009-06-15 11:54:53

pedro-kun
Member
From: Portugal
Registered: 2007-07-20
Posts: 30

Re: Multiple Dzens with XMonad

Thanks, mikesd, that's a good idea indeed :)

I'll still leave the thread open just in case some enlightened soul comes by and answers :D

Offline

#4 2009-06-16 13:45:43

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: Multiple Dzens with XMonad

I start 4 dzen's on startup:

myStatusBar = "dzen2 -x '0' -y '0' -h '24' -w '960' -ta 'l' -fg '#FFFFFF' -bg '#000000' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"
conkyStatsBar = "conky -c .conkyrc_console | dzen2 -x '960' -y '0' -h '24' -w '885' -ta 'l' -fg '#FFFFFF' -bg '#000000' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"
conkyMpdBar = "conky -c .conkyrc_mpd | dzen2 -x '0' -y '1176' -h '24' -w '960' -ta 'l' -fg '#FFFFFF' -bg '#000000' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"
conkyTimeBar = "conky -c .conkyrc_date | dzen2 -x '960' -y '1176' -h '24' -w '960' -ta 'r' -fg '#FFFFFF' -bg '#000000' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"

main = do
    workspaceBar <- spawnPipe myStatusBar
    conkyStats <- spawnPipe conkyStatsBar
    conkyMpd <- spawnPipe conkyMpdBar
    conkyTime <- spawnPipe conkyTimeBar
    xmonad $ withUrgencyHook NoUrgencyHook gnomeConfig {
...
      , logHook     = myLogHook workspaceBar >> fadeInactiveLogHook 0xdddddddd  >> setWMName "LG3D"
...
}

One is formatted with the myLogHook (which I didn't include in this fragment), the rest is judt launched.

Offline

#5 2009-06-16 14:24:16

pedro-kun
Member
From: Portugal
Registered: 2007-07-20
Posts: 30

Re: Multiple Dzens with XMonad

One is formatted with the myLogHook (which I didn't include in this fragment), the rest is judt launched.

The thing is I wanted to format two of them with a logHook. Nevertheless, thanks! :)

Offline

#6 2009-06-16 14:36:23

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Multiple Dzens with XMonad

pedro-kun wrote:

One is formatted with the myLogHook (which I didn't include in this fragment), the rest is judt launched.

The thing is I wanted to format two of them with a logHook. Nevertheless, thanks! smile

That isn't a problem, just set the output of the PP to the pipe you want.  You can also use several PP's to have different output on the two dzens of you want


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2009-06-16 14:42:03

pedro-kun
Member
From: Portugal
Registered: 2007-07-20
Posts: 30

Re: Multiple Dzens with XMonad

That isn't a problem, just set the output of the PP to the pipe you want.  You can also use several PP's to have different output on the two dzens of you want

So, my question is: "How can I use two PP's simultaneously?" :)
I'm not very used to haskell.. so I have some trouble with these things... Could you please explain?

Offline

#8 2009-06-16 15:08:05

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Multiple Dzens with XMonad

logHook pipe1 pipe2 = dynamicLogWithPP $ fooPP { ppOutput = hPutStrLn pipe1 } >> dynamicLogWithPP $ barPP { ppOutput = hPutStrLn pipe2 }

or something like that, I havn't tried it myself.

#xmonad is a nice place btw smile (but quiet sometimes)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB