You are not logged in.

#1 2009-08-10 16:41:15

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

[SOLVED] XMonad + dzen2

I have been staring at this for the last day and I can't figure out why it isn't working.  I cannot for the life of me get topBarCmd or botBarCmd to show up; I pretty much copied these configs from one of my working systems, and just edited them for a different monitor size. 

Relevant XMonad section:

-- dzen config
sBarCmd = "dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -ta l"
topBarCmd = "conky -c ~/.conkyrc | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -x 841 -ta r"
botBarCmd = "conky -c ~/.conky_bottom_dzen | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -y 1034 -w 1680 -ta c"

sBarCmd shows, but the other two don't.  Any ideas?

Last edited by lifeafter2am (2009-08-10 21:49:15)


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

Offline

#2 2009-08-10 16:52:18

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

Re: [SOLVED] XMonad + dzen2

You're going to have to post your whole config. As it stands, you aren't running anything, just setting the commands.

Offline

#3 2009-08-10 17:03:30

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

Re: [SOLVED] XMonad + dzen2

Well yeah, I know that.  big_smile

Here is the whole config though.

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import qualified XMonad.StackSet as W

-- layouts
import XMonad.Layout
import XMonad.Layout.IM
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.Reflect
import XMonad.Layout.Combo
import XMonad.Layout.Grid
import XMonad.Layout.ResizableTile
import Data.Ratio ((%))
import XMonad.Layout.Gaps


-- layout definitions
customLayout = gaps [(D,16)] $ avoidStruts $ ResizableTall 2 (3/100) (1/2) [] ||| withIM (1%7) (ClassName "Buddy List") Grid ||| layoutHook defaultConfig

-- Workspaces
myWorkspaces =  ["1:term","2:www","3:art","4:irc","5:media","6:im","7","8","9"]

-- Window rules
myManageHook = composeAll
    [className =? "wicd-client" --> doFloat
        ,className =? "xine" --> doFloat
    ]

-- icons directory
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"
        , workspaces = myWorkspaces
        , borderWidth = 0
        , normalBorderColor = "#000000"
        , focusedBorderColor = "#3399ff"
        , layoutHook = customLayout
        , 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")
    , ((mod4Mask, xK_a), sendMessage MirrorShrink)
    , ((mod4Mask, xK_z), sendMessage MirrorExpand)
    ]
     ++
 
      --
        -- mod-[1..9], Switch to workspace N
          -- mod-shift-[1..9], Move client to workspace N
      --
        [((m .|. mod4Mask, k), windows $ f i)
        | (i, k) <- zip (myWorkspaces) [xK_1 .. xK_9]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]])



-- dzen config
sBarCmd = "dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -ta l"
topBarCmd = "conky -c /home/ishikawa/.conkyrc | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -x 841 -ta r"
botBarCmd = "conky -c ~/.conky_bottom_dzen | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -y 1034 -w 1680 -ta c"

myDzenPP dzenSbar = defaultPP
     { ppCurrent = wrap "^p()[^fg(#346855)" "^fg()]^p()"
     , ppUrgent = wrap "!^fg(purple)^p()" "^fg()^p()"
     , ppVisible = wrap "^p()[^fg()" "^fg()]^p()"
     , ppTitle = wrap "^fg(#346855)< ^fg(#3a6b7a)" "^fg(#346855) >^fg()" . shorten 90
     , ppSep = " : "
     , ppWsSep = " : "
     , ppLayout = dzenColor "#346855" "#000000" .
            (\x -> case x of
                   "Tall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
                   "Mirror Tall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
                   "Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
           "ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/resizableGrid.xbm)"
           "IM Grid" -> "^i(" ++ myBitmapsDir ++ "/im-layout.xbm)"
                   _ -> x
                   )
     , ppOutput = hPutStrLn dzenSbar
}

Here are my conky's if they help too:

conkyrc:

# Set to yes if you want Conky to be forked in the background
background no

out_to_console yes

# Update interval in seconds
update_interval 1

color1 ef89bb

TEXT
^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/cpu.xbm) ^fg(#346855)${cpu cpu1}% ^fg(#7ebdfc) ^i(/home/ishikawa/.dzen/cpu.xbm) ^fg(#346855)${cpu cpu2}% @ $freq_g GHz ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/mem.xbm) ^fg(#346855)$mem/$memmax ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/net_down.xbm) ^fg(#346855)${downspeed eth1}/${totaldown eth1} ^fg(#7ebdfc)^i(/home/ishikawa/.dzen/net_up.xbm) ^fg(#346855)${upspeed eth1}/${totalup eth1} ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/clock.xbm) ^fg(#346855)${time} ^fg(#7ebdfc)|

conky_bottom_dzen:

# Set to yes if you want Conky to be forked in the background
background no
 
out_to_console yes
 
# Update interval in seconds
update_interval 1
 
# MPD host/port
mpd_host localhost
mpd_port 6600
 
TEXT
^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/net_up_03.xbm) ^fg(#346855)$uptime ^fg(#3a6b7a)| ^fg(#1994d1) ^i(/home/ishikawa/.dzen/arch.xbm) ^fg(#346855)${texeci 1500 perl /home/ishikawa/scripts/xyne-update-checker.pl} ^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/diskette.xbm) ^fg(#346855)${fs_used sda4}/${fs_size sda4} ^fg(#3a6b7a)|^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/note.xbm) ^fg(#346855)$mpd_status : ${mpd_smart 50} ($mpd_elapsed / $mpd_length) ^fg(#3a6b7a)||

As I said, this config works on two other systems, so I am stumped as to why it won't work on this one.


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

Offline

#4 2009-08-10 18:04:32

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] XMonad + dzen2

this /could/ be related.  with the new conky, '#' after TEXT is still treated as comment.  to use your conkyrc's as is you'll have to patch conky to support the \# escape sequence then fix all your #'s with escaped \#'s.  if you've already done this, then well, ignore me.  if not, you can google, or check my website for info regarding the patch.

you might also want to set 'out_to_x no' along with your current 'out_to_console yes' this may have no effect tho.

good luck. 

and by the way, just for my own curiosity; how does ghc know what dzenConkyTop and dzenConkyBottom are? they aren't declared the way dzenSbar is...

i just spawn my second bar outright like this:

main = do
  d <- spawnPipe myStatusBar
  spawn myOtherBar
  xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    {...

where myStatusBar and myOtherBar are defined as yours are and d is fed by myLogHook.

Offline

#5 2009-08-10 18:50:00

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

Re: [SOLVED] XMonad + dzen2

brisbin33 wrote:

this /could/ be related.  with the new conky, '#' after TEXT is still treated as comment.  to use your conkyrc's as is you'll have to patch conky to support the \# escape sequence then fix all your #'s with escaped \#'s.  if you've already done this, then well, ignore me.  if not, you can google, or check my website for info regarding the patch.

you might also want to set 'out_to_x no' along with your current 'out_to_console yes' this may have no effect tho.

good luck. 

and by the way, just for my own curiosity; how does ghc know what dzenConkyTop and dzenConkyBottom are? they aren't declared the way dzenSbar is...

i just spawn my second bar outright like this:

main = do
  d <- spawnPipe myStatusBar
  spawn myOtherBar
  xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    {...

where myStatusBar and myOtherBar are defined as yours are and d is fed by myLogHook.

Does the # problem exist for the conky-cli in the AUR?

Beats me about how XMonad knows about those, I copied them from someone here that had 2 top and a bottom bar.  I know it works though, its the same on the laptops.


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

Offline

#6 2009-08-10 20:50:19

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: [SOLVED] XMonad + dzen2

lifeafter2am: You're problem is indeed related to Conky handling #'s as comments as you've found out as well. The problem also exists for conky-cli since it uses the newest version of conky.

Downgrade to 1.6 or patch and your bars will work. Check out this thread: http://bbs.archlinux.org/viewtopic.php?id=77209

Offline

#7 2009-08-10 21:48:54

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

Re: [SOLVED] XMonad + dzen2

Ashren wrote:

lifeafter2am: You're problem is indeed related to Conky handling #'s as comments as you've found out as well. The problem also exists for conky-cli since it uses the newest version of conky.

Downgrade to 1.6 or patch and your bars will work. Check out this thread: http://bbs.archlinux.org/viewtopic.php?id=77209

Ok thanks.  I edited the PKGBUILD to use 1.6.1 and installed it that way.  Works now!

big_smile


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

Offline

Board footer

Powered by FluxBB