You are not logged in.

#1 2011-01-16 22:36:27

Jaeplane
Member
Registered: 2010-12-24
Posts: 9

[SOLVED] dzen, xmonad and conky; no status bar?

I've been trying to get xmonad, dzen and conky to all work together, but I am having trouble getting the status bar to show up. Nothing shows up after I startx except for my wallpaper that I set with feh. Everything else works fine; there is just no status bar.

I originally had conky-cli but after I read this thread, I saw that conky-cli was no longer needed and that the conky package would work instead, so I got rid of conky-cli for just conky. Below are some relevant configs.


conkyrc

gap_y -1000
 
background no
double_buffer yes 
out_to_console yes 
own_window yes 
own_window_type desktop
update_interval 1.0 
font -*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859-*
 
TEXT
^i(.dzen/bitmaps/sm4tik/cpu.xbm) ${cpu cpu0}% \
^i(.dzen/bitmaps/sm4tik/cpu.xbm) ${cpu cpu1}% \
^i(.dzen/bitmaps/sm4tik/mem.xbm) $memperc% \
^i(.dzen/bitmaps/sm4tik/ac_01.xbm) ${battery_short BAT1} \
^i(.dzen/bitmaps/sm4tik/arch.xbm) ${entropy_avail}/${entropy_poolsize} \
^i(.dzen/bitmaps/sm4tik/clock.xbm) ${time %b %e %H:%M:%S}

xmonad.hs

import XMonad
import XMonad.Core
 
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.Man
 
import XMonad.Layout
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
 
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.SetWMName
 
import XMonad.Util.EZConfig
import XMonad.Util.Run
import Graphics.X11.Xlib
import qualified Data.Map as M
import System.IO
 
main = do
   myStatusBarPipe <- spawnPipe myStatusBar
   conkyBar <- spawnPipe myConkyBar
   xmonad $ myUrgencyHook $ defaultConfig
      { terminal = "urxvt"
      , normalBorderColor  = myInactiveBorderColor
      , focusedBorderColor = myActiveBorderColor
      , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
      , layoutHook = avoidStruts $ myLayoutHook
      , startupHook = setWMName "LG3D"
      , logHook = dynamicLogWithPP $ myDzenPP myStatusBarPipe
      , modMask = mod4Mask
      , keys = myKeys
      , workspaces = myWorkspaces
     }   
 
-- Paths
myBitmapsPath = "/home/jaeplane/.dzenicons/"
 
-- Font
myFont = "-*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859-*"
 
-- Colors
myBgBgColor = "black"
myFgColor = "gray80"
myBgColor = "gray20"
myHighlightedFgColor = "white"
myHighlightedBgColor = "gray40"
 
myActiveBorderColor = "gray80"
myInactiveBorderColor = "gray20"
 
myCurrentWsFgColor = "white"
myCurrentWsBgColor = "gray40"
myVisibleWsFgColor = "gray80"
myVisibleWsBgColor = "gray20"
myHiddenWsFgColor = "gray80"
myHiddenEmptyWsFgColor = "gray50"
myUrgentWsBgColor = "brown"
myTitleFgColor = "white"
 
myUrgencyHintFgColor = "white"
myUrgencyHintBgColor = "brown"
 
-- dzen general options
myDzenGenOpts = "-fg '" ++ myFgColor ++ "' -bg '" ++ myBgColor ++ "' -fn '" ++ myFont ++ "' -h '16'"
 
-- Status Bar
myStatusBar = "dzen2 -w 665 -ta l " ++ myDzenGenOpts
 
-- Conky Bar
myConkyBar = "conky -c ~/.conkyrc | dzen2 -x 660 -w 365 " ++ myDzenGenOpts
 
-- Layouts
myLayoutHook = smartBorders $ (tiled ||| Mirror tiled ||| Full)
  where
    tiled = ResizableTall nmaster delta ratio []
    nmaster = 1
    delta = 3/100
    ratio = 1/2
 
-- Workspaces
myWorkspaces =
   [
      wrapBitmap "arch_10x10.xbm",
      wrapBitmap "fox.xbm",
      wrapBitmap "dish.xbm",
      wrapBitmap "cat.xbm",
      wrapBitmap "empty.xbm",
      wrapBitmap "shroom.xbm",
      wrapBitmap "bug_02.xbm",
      wrapBitmap "eye_l.xbm",
      wrapBitmap "eye_r.xbm"
   ]
   where
      wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"
 
-- Urgency hint configuration
myUrgencyHook = withUrgencyHook dzenUrgencyHook
    {
      args = [
         "-x", "0", "-y", "576", "-h", "15", "-w", "1024",
         "-ta", "r",
         "-fg", "" ++ myUrgencyHintFgColor ++ "",
         "-bg", "" ++ myUrgencyHintBgColor ++ ""
         ]
    }
 
myManageHook = composeAll
   [ className =? "Gimp" --> doFloat ]
 
-- Prompt config
myXPConfig = defaultXPConfig {
  position = Bottom,
  promptBorderWidth = 0,
  height = 15,
  bgColor = myBgColor,
  fgColor = myFgColor,
  fgHLight = myHighlightedFgColor,
  bgHLight = myHighlightedBgColor
  }
 
-- Union default and new key bindings
myKeys x  = M.union (M.fromList (newKeys x)) (keys defaultConfig x)
 
-- Add new and/or redefine key bindings
newKeys conf@(XConfig {XMonad.modMask = modm}) = [
  -- Use shellPrompt instead of default dmenu
  ((modm, xK_p), shellPrompt myXPConfig),
  -- Do not leave useless conky, dzen and xxkb after restart
  ((modm, xK_q), spawn "killall conky dzen2 xxkb; xmonad --recompile; xmonad --restart")
   ]
 
-- Dzen config
myDzenPP h = defaultPP {
  ppOutput = hPutStrLn h,
  ppSep = "^bg(" ++ myBgBgColor ++ ")^r(1,15)^bg()",
  ppWsSep = "",
  ppCurrent = wrapFgBg myCurrentWsFgColor myCurrentWsBgColor,
  ppVisible = wrapFgBg myVisibleWsFgColor myVisibleWsBgColor,
  ppHidden = wrapFg myHiddenWsFgColor,
  ppHiddenNoWindows = wrapFg myHiddenEmptyWsFgColor,
  ppUrgent = wrapBg myUrgentWsBgColor,
  ppTitle = (\x -> " " ++ wrapFg myTitleFgColor x),
  ppLayout  = dzenColor myFgColor"" .
                (\x -> case x of
                    "ResizableTall" -> wrapBitmap "rob/tall.xbm"
                    "Mirror ResizableTall" -> wrapBitmap "rob/mtall.xbm"
                    "Full" -> wrapBitmap "rob/full.xbm"
                )
  }
  where
    wrapFgBg fgColor bgColor content= wrap ("^fg(" ++ fgColor ++ ")^bg(" ++ bgColor ++ ")") "^fg()^bg()" content
    wrapFg color content = wrap ("^fg(" ++ color ++ ")") "^fg()" content
    wrapBg color content = wrap ("^bg(" ++ color ++ ")") "^bg()" content
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"

These configuration files are basically a copy of this xmonad.hs and conky_bar edited for my use. I just renamed conky_bar to conkyrc for my configuration.

Last edited by Jaeplane (2011-01-17 05:48:00)

Offline

#2 2011-01-16 23:42:35

singenbale
Member
Registered: 2010-10-01
Posts: 33

Re: [SOLVED] dzen, xmonad and conky; no status bar?

As done in the post given by you, you should run these apps in a console and see if they start manually and/or post the errors (output) that you get. Also state how you are autostarting them in the first place.

Offline

#3 2011-01-17 15:21:58

Agi93
Member
Registered: 2010-02-07
Posts: 11

Re: [SOLVED] dzen, xmonad and conky; no status bar?

I would recommend this guide: http://pbrisbin.com/posts/xmonad_statusbars/

It's written by brisbin33 on these forums. I would also recommend checking out the rest of his site (pbrisbin.com:8080) since it is full of useful guides and other information. He uses XMonad, Arch, and dzen, so it should be perfect for you (as it is for me).

Have fun with XMonad!

Last edited by Agi93 (2011-01-17 15:22:31)

Offline

#4 2011-02-16 16:35:12

abstrakct
Member
Registered: 2009-07-28
Posts: 35

Re: [SOLVED] dzen, xmonad and conky; no status bar?

I have nothing to do with this thread, just want to say thanks a lot for the link to brisbin's site which really helped me get my dzen2/conky statusbars working nicely in xmonad! Finally I understand how it works - and how to change it to my own liking! Thanks for the link, and thanks to brisbin!

Offline

Board footer

Powered by FluxBB