Xmonad/Config archive/Robert Manea's xmonad.hs and support scripts

From HaskellWiki
import XMonad
import XMonad.Operations
import XMonad.Actions.DwmPromote
import XMonad.Hooks.DynamicLog   ( PP(..), dynamicLogWithPP, dzenColor, wrap, defaultPP )
import XMonad.Layouts            
import XMonad.Layout.NoBorders   ( smartBorders )
import XMonad.Prompt             ( XPConfig(..), XPPosition(..) )
import XMonad.Prompt.Shell       ( shellPrompt )
import XMonad.Util.Run
 
import qualified Data.Map as M
import Data.Bits ((.|.))
import Data.Ratio
import Graphics.X11
import System.IO

statusBarCmd= "dzen2 -bg '#2c2c32' -fg 'grey70' -w 620 -sa c -fn '-*-profont-*-*-*-*-11-*-*-*-*-*-iso8859' -e '' -xs 1 -ta l"

main = do din <- spawnPipe statusBarCmd
          xmonad $ defaultConfig

                     { borderWidth        = 1
                     , normalBorderColor  = "#111111"
                     , focusedBorderColor = "#aecf96" 
                     , workspaces         = ["1:dev", "2:mail", "3:web", "4:comm", "5:ham", "6:tmp"] 
                     , terminal           = "uterm"
                     , modMask            = mod4Mask
                     , defaultGaps        = [(13,0,0,0)]
                     , logHook            = dynamicLogWithPP $ robPP din
					 , layoutHook         = smartBorders $ tiled ||| Mirror tiled ||| Full
                     , keys               = \c -> robKeys `M.union` 
                                                  keys defaultConfig c 
                     }
                     where
                       tiled = Tall 1 (3%100) (680%1000)


-- redifine some keys
--
robKeys = M.fromList $
                   [ ((mod4Mask     , xK_p     ), shellPrompt robSPConfig)
				   , ((mod4Mask     , xK_c     ), spawn "/home/robert/bin/dzencal.sh")
				   , ((mod4Mask     , xK_Return), dwmpromote)
                   ]

-- dynamiclog pretty printer for dzen
--
robPP h = defaultPP 
                 { ppCurrent = wrap "^fg(#000000)^bg(#a6c292)^p(2)^i(/home/robert/dzen_bitmaps/has_win.xbm)" "^p(2)^fg()^bg()"
                  , ppVisible = wrap "^bg(grey30)^fg(grey75)^p(2)" "^p(2)^fg()^bg()"
                  , ppSep     = " ^fg(grey60)^r(3x3)^fg() "
                  , ppLayout  = dzenColor "#80AA83" "" .
                                (\x -> case x of
                                         "Tall" -> "^i(/home/robert/dzen_bitmaps/tall.xbm)"
                                         "Mirror Tall" -> "^i(/home/robert/dzen_bitmaps/mtall.xbm)"
                                         "Full" -> "^i(/home/robert/dzen_bitmaps/full.xbm)"
                                )
                  , ppTitle   = dzenColor "white" "" . wrap "< " " >" 
                  , ppOutput   = hPutStrLn h
                  }

-- shellprompt config
--
robSPConfig = XPC {        font              = -*-profont-*-*-*-*-11-*-*-*-*-*-iso8859"
                         , bgColor           = "#111111"
		         , fgColor           = "#d5d3a7"
		         , bgHLight          = "#aecf96"
		         , fgHLight          = "black"
		         , borderColor       = "black"
                         , promptBorderWidth = 0
		         , position          = Bottom
                         , height            = 15
                         , historySize       = 256
				 }