You are not logged in.

#1 2009-06-20 03:09:53

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

[solved] XMonad and dzen2 with conky

Okay, so I am trying to get conky and dzen2 playing nicely with each other using XMonad as a WM.  I am following someone else's config files and making a few changes here and there.  The problem is somewhere with conky I think, but I am guessing with the parsing of the data into dzen2.  I took a screenshot of what I am getting:

thumb_2009-06-19-225857_1280x800_scrot.png

Now, as you can see the icons show up correctly in the dzen2 bar, but for some reason the text all shows up down on the screen.  The CPU and other stuff is updating, but it keeps flashing on and off, not to mention the it is not where it is supposed to be.

Here is the relevant sections of my XMonad:

-- custom stuff
myBitmapsDir = "/home/ishikawa/.dzen"

-- main config
main = do
    dzenSbar <- spawnPipe sBarCmd
    dzenConkyTop <- spawnPipe topBarCmd
--    dzenConkyBot <- spawnPipe botBarCmd
    spawn "xcompmgr"  
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , terminal = "urxvt"
        , borderWidth = 1
        , normalBorderColor = "#000000"
        , focusedBorderColor = "#3399ff"
        , layoutHook = avoidStruts  $  layoutHook defaultConfig
        , logHook = dynamicLogWithPP $ myDzenPP dzenSbar
        , modMask = mod4Mask     -- Rebind Mod to the Windows key
        } `additionalKeys`
        [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
        , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
        , ((0, xK_Print), spawn "scrot")
        ]

-- dzen config
sBarCmd = "dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#f0f0f0' -h 16 -w 640 -ta l"
topBarCmd = "conky -c ~/.conkyrc | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#f0f0f0' -h 16 -w 600 -x 640 -ta c"
-- botBarCmd = "conky -c ~/.conky_botrc | dzen2 -fn 'arial' -bg '#000000' -fg '#f0f0f0' -h '16' -y 848 -w 1152 -ta 'l'"

myDzenPP dzenSbar = defaultPP
     { ppCurrent = wrap "^p()[^fg(green)" "^fg()]^p()"
     , ppUrgent = wrap "!^fg(purple)^p()" "^fg()^p()"
     , ppVisible = wrap "^p()[^fg()" "^fg()]^p()"
     , ppTitle = wrap "^fg(green)< ^fg(white)" "^fg(green) >^fg()" . shorten 60
     , ppSep = " : "
     , ppWsSep = " : "
     , ppLayout = dzenColor "#ffffff" "#000000" .
            (\x -> case x of
                   "Tall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
                   "Mirror Tall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
                   "Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
                   _ -> x
                   )
     , ppOutput = hPutStrLn dzenSbar
}

From looking at the config file you can see that dzen2 is working for dzenSbar, and that it shows up correctly for dzenConkyTop, but doesn't display the information from conky only the icons.  I commented out the bottom bar for now, I can tackle that after this.  smile

Last edited by lifeafter2am (2009-06-20 03:41:16)


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#2 2009-06-20 03:18:14

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: [solved] XMonad and dzen2 with conky

Are you using conky-cli, from the AUR?

Offline

#3 2009-06-20 03:21:09

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: [solved] XMonad and dzen2 with conky

No, should I be?  I thought that conky-cli was it's own binary excutable (conky-cli), so I figured that this person was using normal conky.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#4 2009-06-20 03:24:16

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: [solved] XMonad and dzen2 with conky

No, it's conky compiled so that it outputs to the command line on it's own. You should be using it.

Offline

#5 2009-06-20 03:30:18

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: [solved] XMonad and dzen2 with conky

Wow, I feel seriously dumb right now.  hmm

Thanks SamC!  big_smile


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#6 2009-06-20 12:49:28

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

Re: [solved] XMonad and dzen2 with conky

With the latest conky from extra, you can set a directive to only output to console or x:

out_to_x yes/no
out_to_console yes/no

Offline

Board footer

Powered by FluxBB