You are not logged in.

#1 2010-07-28 21:34:54

yphqyn
Member
Registered: 2009-04-23
Posts: 20

[SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

Hi!

Before I adding to my layoutHook 'spacing 6', dzen2's statusbar (in left corner of screen - it shows workspace's name) work fine:
http://img843.imageshack.us/img843/3654 … ingadd.png

but, when I added it (spacing 6), dzen2's workspaces name gone:
http://img153.imageshack.us/img153/5356 … ingadd.png

In this two pictures You have part of my xmonad.hs' file.
Dynamiclog pretty printer for dzen looks like:

robPP h = defaultPP 
                 { ppCurrent = wrap "^fg(#000000)^bg(#a6c292)^p(4)" "^p(4)^fg()^bg()"
                  , ppHidden = wrap "^bg(grey10)^fg(grey75)^p(4)" "^p(4)^fg()^bg()"
                  , ppSep     = " ^fg(grey60)^r(3x3)^fg() "
                  , ppLayout  = dzenColor "#80AA83" "" .
                                (\x -> case x of
                                         "Tall" -> icon "tall.xbm"
                                         "Mirror Tall" -> icon "mtall.xbm"
                                         "Full" -> icon "full.xbm"
                                )
                  , ppTitle   = dzenColor "#FFFFFF" "" . wrap "[ " " ]" 
                  , ppOutput   = hPutStrLn h
                  }
        where
            icon h = "^i(/home/ksl/.xmonad/icons/" ++ h ++ ")"
            fill :: String -> Int -> String
            fill h i = "^p(" ++ show i ++ ")" ++ h ++ "^p(" ++ show i ++ ")"

What's wrong with it ?
Regards Chris.

Last edited by yphqyn (2010-09-17 16:58:45)

Offline

#2 2010-07-28 22:47:01

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

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

You'd better post your entire xmonad.hs, seeing as the issue seems to be with starting DynamicLog.

Offline

#3 2010-07-29 07:04:23

yphqyn
Member
Registered: 2009-04-23
Posts: 20

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

import XMonad.Operations
import XMonad.Actions.DwmPromote
import XMonad.Hooks.DynamicLog   ( PP(..), dynamicLogWithPP, dzenColor, wrap, defaultPP )

import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
import XMonad.Layout
import XMonad.Layout.Grid
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile

import XMonad.Prompt             ( XPConfig(..), XPPosition(..) )
import XMonad.Prompt.Shell       ( shellPrompt )
import XMonad.Util.Run
import XMonad.Hooks.ManageDocks

import qualified Data.Map as M
import Data.Bits ((.|.))
import Data.Ratio
import Graphics.X11
import System.IO

statusBarLeft= "dzen2 -bg 'grey10' -fg '#aecf96' -sa c -fn '-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*' -ta l -w 580"

main = do din <- spawnPipe statusBarLeft
          xmonad $ defaultConfig
                     { borderWidth        = 1
                     , normalBorderColor  = "grey30"
                     , focusedBorderColor = "#aecf96"
                     , workspaces         = ["1:work!", "2:ports/cvsup", "3:code/dev", "4:misc", "5:wifi/aircrack","6:irc/gg/mail/rss","7:rtorrent","8:mjuzik/media", "9:www"]
                     , terminal           = "urxvt +sb -tr -sh 30 -bg black -fg white"
                     , modMask            = mod4Mask
                     , manageHook         = myManageHook
                     , logHook            = dynamicLogWithPP $ robPP din
                     , layoutHook         = avoidStruts (spacing 6 $ gaps [(U,6), (D,6), (R,6), (L,6)] $ tiled ||| Mirror tiled ||| Grid ||| noBorders Full)
                    -- , layoutHook       = avoidStruts (gaps [(U,6), (D,6), (R,6), (L,6)] $ tiled ||| Mirror tiled ||| Grid ||| noBorders Full)
                     , keys               = \c -> robKeys `M.union` 
                                                  keys defaultConfig c 
                     }
                     where
                       tiled = Tall 1 (3/100) (2/3)
                       reztiled = ResizableTall 1 (3/100) (1/2)
 
 
myManageHook :: ManageHook
myManageHook = composeAll
                [ className =? "Pidgin"     --> doFloat
                , className =? "Gimp"       --> doFloat ]

-- redifine some keys
--
robKeys = M.fromList $
   [ ((mod4Mask     , xK_p      ), shellPrompt robSPConfig)
   , ((mod4Mask     , xK_c      ), spawn "rxvt -e xterm ~/.xmonad/xmonad.hs")
   , ((mod4Mask     , xK_Return ), dwmpromote)
   , ((mod4Mask     , xK_b      ), sendMessage ToggleStruts)
   , ((mod4Mask .|. shiftMask,  xK_b    ), spawn "chromium")
   , ((mod4Mask .|. shiftMask,  xK_p    ), spawn "pidgin")
 
   -- multimedia keys
   --
   -- XF86AudioLowerVolume
   , ((0            , 0x1008ff11), spawn "aumix -v -2")
   -- XF86AudioRaiseVolume
   , ((0            , 0x1008ff13), spawn "aumix -v +2")
   -- XF86AudioMute
   , ((0            , 0x1008ff12), spawn "amixer -q set PCM toggle")
   -- XF86AudioNext
   , ((0            , 0x1008ff17), spawn "mpc next")
   -- XF86AudioPrev
   , ((0            , 0x1008ff16), spawn "mpc prev")
   -- XF86AudioPlay
   , ((0            , 0x1008ff14), spawn "mpc toggle")
   ]
 
 
-- dynamiclog pretty printer for dzen
--
robPP h = defaultPP 
                 { ppCurrent = wrap "^fg(#000000)^bg(#a6c292)^p(4)" "^p(4)^fg()^bg()"
                  , ppHidden = wrap "^bg(grey10)^fg(grey75)^p(4)" "^p(4)^fg()^bg()"
                  , ppSep     = " ^fg(grey60)^r(3x3)^fg() "
                  , ppLayout  = dzenColor "#80AA83" "" .
                                (\x -> case x of
                                         "Tall" -> icon "tall.xbm"
                                         "Mirror Tall" -> icon "mtall.xbm"
                                         "Full" -> icon "full.xbm"
                                )
                  , ppTitle   = dzenColor "#FFFFFF" "" . wrap "[ " " ]" 
                  , ppOutput   = hPutStrLn h
                  }
        where
            icon h = "^i(/home/ksl/.xmonad/icons/" ++ h ++ ")"
            fill :: String -> Int -> String
            fill h i = "^p(" ++ show i ++ ")" ++ h ++ "^p(" ++ show i ++ ")"
 
-- shellprompt config
--
robSPConfig = XPC { 
                   font              = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
                 , bgColor           = "#111111"
                 , defaultText       = ""
                 , fgColor           = "#d5d3a7"
                 , bgHLight          = "#aecf96"
                 , fgHLight          = "#000000"
                 , borderColor       = "#000000"
                 , promptBorderWidth = 0
                 , position          = Bottom
                 , height            = 15
                 , historySize       = 256
                   }

Offline

#4 2010-07-29 07:18:57

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

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

Does 'xmonad --recompile' work for you? Because I get quite a few errors when I try it on my machine.

Offline

#5 2010-07-29 07:23:25

yphqyn
Member
Registered: 2009-04-23
Posts: 20

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

before
import XMonad.Operations
You must add
import XMonad

I lost it, when I copying

Last edited by yphqyn (2010-07-29 07:39:18)

Offline

#6 2010-07-29 07:29:42

splittercode
Member
From: WI, USA
Registered: 2010-03-16
Posts: 203

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

I think your problem might be caused by using XMonad.Layout.Gaps and XMonad.Layout.Spacing at the same time.  I suggest trying it without the 'gaps [(U,6), (D,6), (R,6), (L,6)]' part and see if that works.

Offline

#7 2010-07-29 07:46:47

yphqyn
Member
Registered: 2009-04-23
Posts: 20

Re: [SOLVED] xmonad, dzen2's bar doesn't work with spacing around windows

problem solved with Anntoin's help.

Anntoin wrote:

In the case statement where you choose which icon is displayed there is not a complete list of possibilities which may be causing your problem. If you change it to something like this it should work (there could be other problems too):

(λx → case x of
                                         "Tall" → icon "tall.xbm"
                                         "Mirror Tall" → icon "mtall.xbm"
                                         "Full" → icon "full.xbm"
                                         _      → icon "other.xbm"
                                )

In case you don't already know the _ symbol is used to represent anything i.e. we don't care what the value is, so for this case statement if none of the previous cases match the last will (the cases are tried in order).

thanks again (:
reg yp

Last edited by yphqyn (2010-09-17 16:57:35)

Offline

Board footer

Powered by FluxBB