defm03

/And1's xmonad.hs (darcs)

Jun 26th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haskell 18.96 KB | None | 0 0
  1. ------------------------------------------------------------------------
  2. -- ~/.xmonad/xmonad.hs
  3. -- validate syntax: xmonad --recompile
  4. {-# LANGUAGE NoMonomorphismRestriction #-}
  5. ------------------------------------------------------------------------
  6.  
  7. import XMonad hiding (Tall)
  8. import XMonad.Actions.CycleWS
  9. import XMonad.Actions.FloatKeys
  10. import XMonad.Actions.GridSelect
  11. import XMonad.Hooks.DynamicHooks
  12. import XMonad.Hooks.DynamicLog
  13. import XMonad.Hooks.ManageDocks
  14. import XMonad.Hooks.ManageHelpers
  15. import XMonad.Hooks.UrgencyHook
  16. import XMonad.Layout.ComboP
  17. import XMonad.Layout.LayoutCombinators hiding ((|||))
  18. import XMonad.Layout.LayoutHints
  19. import XMonad.Layout.NoBorders
  20. import XMonad.Layout.PerWorkspace
  21. import XMonad.Layout.ResizableTile
  22. import XMonad.Layout.Tabbed
  23. import XMonad.Layout.TwoPane
  24. import XMonad.ManageHook
  25. import XMonad.Prompt
  26. import XMonad.Prompt.Shell
  27. import XMonad.Util.Run
  28. import Control.Monad (liftM2)
  29. import Data.Monoid
  30. import Graphics.X11
  31. import Graphics.X11.Xinerama
  32. import System.Exit
  33. import System.IO
  34.  
  35. import qualified XMonad.Actions.FlexibleResize as Flex
  36. import qualified XMonad.StackSet as W
  37. import qualified Data.Map as M
  38.  
  39. -- XMonad:
  40. main = do
  41.   dzen <- spawnPipe myStatusBar
  42.   conkytop <- spawnPipe myTopBar
  43.   conkympd <- spawnPipe myMPDBar
  44.   conkyhdd <- spawnPipe myHDDBar
  45.   xmonad $ myUrgencyHook $ defaultConfig
  46.  
  47.     { terminal           = myTerminal
  48.     , focusFollowsMouse  = myFocusFollowsMouse
  49.     , borderWidth        = myBorderWidth
  50.     , modMask            = myModMask
  51.     , workspaces         = myWorkspaces
  52.     , normalBorderColor  = myNormalBorderColor
  53.     , focusedBorderColor = myFocusedBorderColor
  54.  
  55.     , keys               = myKeys
  56.     , mouseBindings      = myMouseBindings
  57.  
  58.     , layoutHook         = myLayout
  59.     , manageHook         = myManageHook <+> manageDocks <+> dynamicMasterHook
  60.     , handleEventHook    = myEventHook
  61.     , logHook            = dynamicLogWithPP $ myDzenPP_ dzen
  62.     , startupHook        = myStartupHook
  63.     }
  64.  
  65. myTerminal = "urxvt"
  66. myFocusFollowsMouse = True
  67. myBorderWidth = 1
  68. myModMask = mod1Mask
  69. myWorkspaces = ["1:irc", "2:www", "3:music", "4:misc", "5:xbmc", "6:GIMP", "7:slideshow!", "8:foo()", "9:vbox"]
  70. myNormalBorderColor = "#0f0f0f"
  71. myFocusedBorderColor = "#1f1f1f"
  72.  
  73. myEventHook = mempty
  74. myStartupHook = return ()
  75.  
  76. -- Color, font and iconpath definitions:
  77. myFont = "-*-montecarlo-medium-r-normal-*-11-*-*-*-c-*-*-*"
  78. myIconDir = "/home/and1/.dzen"
  79. myDzenFGColor = "#555555"
  80. myDzenBGColor = "#222222"
  81. myNormalFGColor = "#ffffff"
  82. myNormalBGColor = "#0f0f0f"
  83. myFocusedFGColor = "#f0f0f0"
  84. myFocusedBGColor = "#333333"
  85. myUrgentFGColor = "#0099ff"
  86. myUrgentBGColor = "#0077ff"
  87. myIconFGColor = "#777777"
  88. myIconBGColor = "#0f0f0f"
  89. myPatternColor = "#1f1f1f"
  90. mySeperatorColor = "#555555"
  91.  
  92. -- GSConfig options:
  93. myGSConfig = defaultGSConfig
  94.     { gs_cellheight = 50
  95.     , gs_cellwidth = 250
  96.     , gs_cellpadding = 10
  97.     , gs_font = "" ++ myFont ++ ""
  98.     }
  99.  
  100. -- XPConfig options:
  101. myXPConfig = defaultXPConfig
  102.     { font = "" ++ myFont ++ ""
  103.     , bgColor = "" ++ myNormalBGColor ++ ""
  104.     , fgColor = "" ++ myNormalFGColor ++ ""
  105.     , fgHLight = "" ++ myNormalFGColor ++ ""
  106.     , bgHLight = "" ++ myUrgentBGColor ++ ""
  107.     , borderColor = "" ++ myFocusedBorderColor ++ ""
  108.     , promptBorderWidth = 1
  109.     , position = Bottom
  110.     , height = 16
  111.     , historySize = 100
  112.     }
  113.  
  114. -- Theme options:
  115. myTheme = defaultTheme
  116.     { activeColor = "" ++ myFocusedBGColor ++ ""
  117.     , inactiveColor = "" ++ myDzenBGColor ++ ""
  118.     , urgentColor = "" ++ myUrgentBGColor ++ ""
  119.     , activeBorderColor = "" ++ myFocusedBorderColor ++ ""
  120.     , inactiveBorderColor = "" ++ myNormalBorderColor ++ ""
  121.     , urgentBorderColor = "" ++ myNormalBorderColor ++ ""
  122.     , activeTextColor = "" ++ myFocusedFGColor ++ ""
  123.     , inactiveTextColor = "" ++ myDzenFGColor ++ ""
  124.     , urgentTextColor = "" ++ myUrgentFGColor ++ ""
  125.     , fontName = "" ++ myFont ++ ""
  126.     }
  127.  
  128. -- Statusbar options:
  129. myStatusBar = "dzen2 -x '0' -y '0' -h '16' -w '1300' -ta 'l' -fg '" ++ myNormalFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
  130. myTopBar = "conky -c .conkytop | dzen2 -x '1300' -y '0' -h '16' -w '620' -ta 'r' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
  131. myMPDBar = "conky -c .conkympd | dzen2 -x '0' -y '1184' -h '16' -w '1600' -ta 'l' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
  132. myHDDBar = "conky -c .conkyhdd | dzen2 -x '1600' -y '1184' -h '16' -w '320' -ta 'r' -fg '" ++ myDzenFGColor ++ "' -bg '" ++ myNormalBGColor ++ "' -fn '" ++ myFont ++ "'"
  133.  
  134. -- Urgency hint options:
  135. myUrgencyHook = withUrgencyHook dzenUrgencyHook
  136.     { args = ["-x", "0", "-y", "1184", "-h", "16", "-w", "1920", "-ta", "r", "-expand", "l", "-fg", "" ++ myUrgentFGColor ++ "", "-bg", "" ++ myNormalBGColor ++ "", "-fn", "" ++ myFont ++ ""] }
  137.  
  138. -- Layouts:
  139. myLayout = avoidStruts $ layoutHints $ onWorkspace "1:irc" (resizableTile ||| Mirror resizableTile) $ onWorkspace "6:GIMP" gimpLayout $ smartBorders (Full ||| resizableTile ||| Mirror resizableTile)
  140.     where
  141.     resizableTile = ResizableTall nmaster delta ratio []
  142.     tabbedLayout = tabbedBottomAlways shrinkText myTheme
  143.     gimpLayout = combineTwoP (TwoPane 0.04 0.82) (tabbedLayout) (Full) (Not (Role "gimp-toolbox"))
  144.     nmaster = 1
  145.     ratio = toRational (2/(1+sqrt(5)::Double))
  146.     delta = 3/100
  147.  
  148. -- Key bindings:
  149. myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
  150.     [ ((mod4Mask, xK_q), spawn "urxvt -name irssi -e ssh and1@server")
  151.     , ((mod4Mask, xK_w), spawn "nitrogen --no-recurse --sort=alpha")
  152.     , ((mod4Mask, xK_e), spawn "chromium")
  153.     , ((mod4Mask, xK_r), spawn "urxvt")
  154.     , ((mod4Mask .|. shiftMask, xK_r), oneShotHook (className =? "URxvt") (doF $ (W.swapUp . W.shiftMaster)) >> spawn "urxvt")
  155.     , ((mod4Mask, xK_i), spawn "inkscape")
  156.     , ((mod4Mask, xK_o), spawn "libreoffice")
  157.     , ((mod4Mask, xK_p), shellPrompt myXPConfig)
  158.     , ((mod4Mask, xK_s), spawn "feh --auto-zoom --full-screen --hide-pointer --randomize --slideshow-delay 5 --title \"feh() | %n\" /home/and1/wallpapers/*.jpg /home/and1/wallpapers/*.png")
  159.     , ((mod4Mask, xK_f), oneShotHook (className =? "URxvt") doFloat >> spawn "urxvt -g 100x25+25+875") -- MonteCarlo
  160.     , ((mod4Mask .|. shiftMask, xK_f), oneShotHook (className =? "URxvt") doFloat >> spawn "urxvt -g 100x10+25+1040") -- MonteCarlo
  161.     , ((mod4Mask, xK_g), spawn "gimp")
  162.     , ((mod4Mask, xK_k), spawn "k3b")
  163.     , ((mod4Mask, xK_l), spawn "slock")
  164.     , ((mod4Mask, xK_x), spawn "xbmc")
  165.     , ((mod4Mask, xK_v), spawn "virtualbox")
  166.     , ((mod4Mask, xK_n), spawn "nautilus")
  167.     , ((mod4Mask, xK_m), spawn "gmpc")
  168.     , ((mod4Mask, xK_Print), spawn "scrot screen_%Y-%m-%d.png -d 1") -- take screenshot
  169.     , ((modMask .|. controlMask, xK_Home), spawn "mpc toggle") -- play/pause song
  170.     , ((modMask .|. controlMask, xK_End), spawn "mpc stop") -- stop playback
  171.     , ((modMask .|. controlMask, xK_Prior), spawn "mpc prev") -- previous song
  172.     , ((modMask .|. controlMask, xK_Next), spawn "mpc next") -- next song
  173.     , ((modMask, xK_Tab), windows W.focusDown) -- move focus to the next window
  174.     , ((modMask, xK_j), windows W.focusDown) -- move focus to the next window
  175.     , ((modMask, xK_k), windows W.focusUp) -- move focus to the previous window
  176.     , ((modMask, xK_b), sendMessage ToggleStruts) -- toggle the statusbar gap
  177.     , ((modMask, xK_m), windows W.swapMaster) -- swap the focused window and the master window
  178.     , ((modMask, xK_comma), sendMessage (IncMasterN 1)) -- increment the number of windows in the master area
  179.     , ((modMask, xK_period), sendMessage (IncMasterN (-1))) -- deincrement the number of windows in the master area
  180.     , ((modMask, xK_Return), windows W.focusMaster) -- move focus to the master window
  181.     , ((modMask, xK_f), sendMessage NextLayout) -- rotate through the available layout algorithms
  182.     , ((modMask, xK_g), goToSelected myGSConfig) -- display grid select and go to selected window
  183.     , ((modMask, xK_Left), prevWS) -- switch to previous workspace
  184.     , ((modMask, xK_Right), nextWS) -- switch to next workspace
  185.     , ((modMask .|. shiftMask, xK_Tab), windows W.focusUp) -- move focus to the previous window
  186.     , ((modMask .|. shiftMask, xK_g), gridselectWorkspace myGSConfig W.view) -- display grid select and go to selected workspace
  187.     , ((modMask .|. shiftMask, xK_h), sendMessage Shrink) -- shrink the master area
  188.     , ((modMask .|. shiftMask, xK_j), windows W.swapDown) -- swap the focused window with the next window
  189.     , ((modMask .|. shiftMask, xK_k), windows W.swapUp)  -- swap the focused window with the previous window
  190.     , ((modMask .|. shiftMask, xK_l), sendMessage Expand) -- expand the master area
  191.     , ((modMask .|. shiftMask, xK_Return), focusUrgent) -- move focus to urgent window
  192.     , ((modMask .|. controlMask, xK_q), io (exitWith ExitSuccess)) -- quit xmonad
  193.     , ((modMask .|. controlMask, xK_r), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart") -- restart xmonad
  194.     , ((modMask .|. controlMask, xK_d), withFocused $ windows . W.sink) -- push window back into tiling
  195.     , ((modMask .|. controlMask, xK_f), setLayout $ XMonad.layoutHook conf) -- reset the layouts on the current workspace to default
  196.     , ((modMask .|. controlMask, xK_h), sendMessage MirrorExpand) -- expand the height/width
  197.     , ((modMask .|. controlMask, xK_j), windows W.swapDown) -- swap the focused window with the next window
  198.     , ((modMask .|. controlMask, xK_k), windows W.swapUp)  -- swap the focused window with the previous window
  199.     , ((modMask .|. controlMask, xK_l), sendMessage MirrorShrink) -- shrink the height/width
  200.     , ((modMask .|. controlMask, xK_x), kill) -- close focused window
  201.     , ((modMask .|. controlMask, xK_Left), withFocused (keysMoveWindow (-30,0))) -- move floated window 10 pixels left
  202.     , ((modMask .|. controlMask, xK_Right), withFocused (keysMoveWindow (30,0))) -- move floated window 10 pixels right
  203.     , ((modMask .|. controlMask, xK_Up), withFocused (keysMoveWindow (0,-30))) -- move floated window 10 pixels up
  204.     , ((modMask .|. controlMask, xK_Down), withFocused (keysMoveWindow (0,30))) -- move floated window 10 pixels down
  205.     ]
  206.     ++
  207.     [ ((m .|. modMask, k), windows $ f i)
  208.     | (i, k) <- zip (XMonad.workspaces conf) [xK_F1 .. xK_F9] -- mod-[F1..F9], switch to workspace n
  209.     --, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] -- mod-shift-[F1..F9], move window to workspace n
  210.     , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] -- mod-shift-[F1..F9], move window to workspace n
  211.     ]
  212.     ++
  213.     [ ((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
  214.     | (key, sc) <- zip [xK_F10, xK_F11, xK_F12] [0..] -- mod-{F10,F11,F12}, switch to physical/Xinerama screens 1, 2, or 3
  215.     , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] -- mod-shift-{F10,F11,F12}, move window to screen 1, 2, or 3
  216.     ]
  217.  
  218. -- Mouse bindings:
  219. myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
  220.     [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster)) -- set the window to floating mode and move by dragging
  221.     , ((modMask, button2), (\w -> focus w >> windows W.shiftMaster)) -- raise the window to the top of the stack
  222.     , ((modMask, button3), (\w -> focus w >> Flex.mouseResizeWindow w)) -- set the window to floating mode and resize by dragging
  223.     , ((modMask, button4), (\_ -> prevWS)) -- switch to previous workspace
  224.     , ((modMask, button5), (\_ -> nextWS)) -- switch to next workspace
  225.     ]
  226.  
  227. -- Window rules:
  228. myManageHook = composeAll . concat $
  229.     [ [isDialog --> doFloat]
  230.     , [className =? c --> doFloat | c <- myCFloats]
  231.     , [title =? t --> doFloat | t <- myTFloats]
  232.     , [resource =? r --> doFloat | r <- myRFloats]
  233.     , [resource =? i --> doIgnore | i <- myIgnores]
  234.     , [(className =? x <||> title =? x <||> resource =? x) --> doShift "1:irc" | x <- my1Shifts]
  235.     , [(className =? x <||> title =? x <||> resource =? x) --> doShift "2:www" | x <- my2Shifts]
  236.     , [(className =? x <||> title =? x <||> resource =? x) --> doShift "3:music" | x <- my3Shifts]
  237.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "4:misc" | x <- my4Shifts]
  238.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "5:xbmc" | x <- my5Shifts]
  239.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "6:GIMP" | x <- my6Shifts]
  240.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "7:slideshow!" | x <- my7Shifts]
  241.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "8:foo()" | x <- my8Shifts]
  242.     , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "9:vbox" | x <- my9Shifts]
  243.     ]
  244.     where
  245.     doShiftAndGo = doF . liftM2 (.) W.greedyView W.shift
  246.     myCFloats = ["Ekiga", "MPlayer", "Nitrogen", "Nvidia-settings", "Skype", "Sysinfo", "XCalc", "XFontSel", "Xmessage"]
  247.     myTFloats = ["Downloads", "Iceweasel Preferences", "Save As..."]
  248.     myRFloats = []
  249.     myIgnores = ["desktop_window", "kdesktop"]
  250.     my1Shifts = []
  251.     my2Shifts = ["Chromium"]
  252.     my3Shifts = ["Deadbeef", "Gmpc"]
  253.     my4Shifts = ["Eog", "Evince", "Gthumb", "Nautilus", "Pcmanfm", "Pinta"]
  254.     my5Shifts = ["MPlayer", "xbmc.bin"]
  255.     my6Shifts = ["Gimp"]
  256.     my7Shifts = ["feh"]
  257.     my8Shifts = ["Easytag", "Gconf-editor", "Inkscape", "K3b", "MusicBrainz Picard", "tmw", "Twf", "VCLSalFrame.DocumentWindow"]
  258.     my9Shifts = ["VirtualBox", "Wine"]
  259.  
  260. -- dynamicLog pretty printer for dzen:
  261. myDzenPP h = defaultPP
  262.     { ppCurrent = wrap ("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myNormalFGColor ++ ")") "^fg()^bg()^p()" . \wsId -> dropIx wsId
  263.     , ppVisible = wrap ("^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myNormalFGColor ++ ")") "^fg()^bg()^p()" . \wsId -> dropIx wsId
  264.     , ppHidden = wrap ("^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId -- don't use ^fg() here!!
  265.     --, ppHiddenNoWindows = wrap ("^fg(" ++ myDzenFGColor ++ ")^bg()^p()^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . \wsId -> dropIx wsId
  266.     , ppHiddenNoWindows = \wsId -> if wsId `notElem` staticWs then "" else wrap ("^fg(" ++ myDzenFGColor ++ ")^bg()^p()^i(" ++ myIconDir ++ "/corner.xbm)") "^fg()^bg()^p()" . dropIx $ wsId
  267.     , ppUrgent = wrap (("^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p()^i(" ++ myIconDir ++ "/corner.xbm)^fg(" ++ myUrgentFGColor ++ ")")) "^fg()^bg()^p()" . \wsId -> dropIx wsId
  268.     , ppSep = " "
  269.     , ppWsSep = " "
  270.     , ppTitle = dzenColor ("" ++ myNormalFGColor ++ "") "" . wrap "< " " >"
  271.     , ppLayout = dzenColor ("" ++ myNormalFGColor ++ "") "" .
  272.         (\x -> case x of
  273.         "Hinted Full" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-full.xbm)"
  274.         "Hinted ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-tall-right.xbm)"
  275.         "Hinted Mirror ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-mirror-bottom.xbm)"
  276.         --"Hinted combining Tabbed Bottom Simplest and Full with DragPane  Vertical 0.1 0.8" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
  277.         "Hinted combining Tabbed Bottom Simplest and Full with TwoPane using Not (Role \"gimp-toolbox\")" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
  278.         _ -> x
  279.         )
  280.     , ppOutput = hPutStrLn h
  281.     }
  282.     where
  283.     dropIx wsId = if (':' `elem` wsId) then drop 2 wsId else wsId
  284.     staticWs = ["1:irc", "2:www", "3:music", "4:misc", "5:xbmc"]
  285.  
  286. -- dynamicLog pretty printer for dzen:
  287. myDzenPP_ h = defaultPP
  288.     { ppCurrent = wrap ("^p(2)^ib(1)^fg(" ++ myFocusedBGColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p()``^fg(" ++ myNormalFGColor ++ ")^p(2)") ("^p(2)^fg(" ++ myFocusedBGColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^ib(0)^fg()^bg()^p()") . \wsId -> dropIx wsId
  289.     , ppVisible = wrap ("^p(2)^ib(1)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^fg(" ++ myNormalFGColor ++ ")^bg(" ++ myFocusedBGColor ++ ")^p()``^fg(" ++ myNormalFGColor ++ ")^p(2)") ("^p(2)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^ib(0)^fg()^bg()^p()") . \wsId -> dropIx wsId
  290.     , ppHidden = wrap ("^p(2)^ib(1)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^fg()^bg()^p()``^p(2)") ("^p(2)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^p()^ib(0)^fg()^bg()^p()") . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId -- don't use ^fg() here!!
  291.     , ppHiddenNoWindows = \wsId -> if wsId `notElem` staticWs then "" else wrap ("^p(2)^ib(1)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^fg(" ++ myDzenFGColor ++ ")^bg()^p()``^p(2)") ("^p(2)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^ib(0)^fg()^bg()^p()") . dropIx $ wsId
  292.     , ppUrgent = wrap (("^p(2)^ib(1)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^fg(" ++ myUrgentFGColor ++ ")^bg(" ++ myNormalBGColor ++ ")^p()``^fg(" ++ myUrgentFGColor ++ ")^p(2)")) ("^p(2)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^ib(0)^fg()^bg()^p()") . \wsId -> dropIx wsId
  293.     , ppSep = " "
  294.     , ppWsSep = ""
  295.     , ppTitle = dzenColor ("" ++ myNormalFGColor ++ "") "" . wrap ("^ib(1)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_left.xbm)^r(1300x12)^p(-1300)^p(2)^fg()< ") (" >^p(2)^fg(" ++ myPatternColor ++ ")^i(" ++ myIconDir ++ "/corner_right.xbm)^fg(" ++ myNormalBGColor ++ ")^r(1300x12)^p(-1300)^ib(0)^fg()")
  296.     , ppLayout = dzenColor ("" ++ myNormalFGColor ++ "") "" .
  297.         (\x -> case x of
  298.         "Hinted Full" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-full.xbm)"
  299.         "Hinted ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-tall-right.xbm)"
  300.         "Hinted Mirror ResizableTall" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-mirror-bottom.xbm)"
  301.         --"Hinted combining Tabbed Bottom Simplest and Full with DragPane  Vertical 0.1 0.8" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
  302.         "Hinted combining Tabbed Bottom Simplest and Full with TwoPane using Not (Role \"gimp-toolbox\")" -> "^fg(" ++ myIconFGColor ++ ")^i(" ++ myIconDir ++ "/layout-gimp.xbm)"
  303.         _ -> x
  304.         )
  305.     , ppOutput = hPutStrLn h
  306.     }
  307.     where
  308.     dropIx wsId = if (':' `elem` wsId) then drop 2 wsId else wsId
  309.     staticWs = ["1:irc", "2:www", "3:music", "4:misc", "5:xbmc"]
Advertisement
Add Comment
Please, Sign In to add comment