daily pastebin goal
69%
SHARE
TWEET

xmonad.hs Aeva

a guest Apr 25th, 2012 400 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- Imports {{{
  2. import XMonad
  3. import System.IO
  4. import qualified Data.Map as M
  5. import qualified XMonad.StackSet as S
  6. -- Actions
  7. import XMonad.Actions.CycleWS
  8. import XMonad.Actions.GridSelect
  9. -- Configurations
  10. import XMonad.Config.Azerty
  11. -- Layouts
  12. import XMonad.Layout.Grid
  13. -- Hooks
  14. import XMonad.Hooks.DynamicLog
  15. import XMonad.Hooks.EwmhDesktops
  16. import XMonad.Hooks.ManageDocks
  17. -- Utilities
  18. import XMonad.Util.EZConfig
  19. import XMonad.Util.Run
  20. --- }}}
  21.  
  22. --- Local Variables {{{
  23. myBorderWidth = 2
  24. myFocusedBorderColor = "#DC143C" -- crimson
  25. myFocusFollowsMouse :: Bool
  26. myFocusFollowsMouse = True
  27. myModMask = mod4Mask
  28. myTerminal = "urxvt"
  29. myWorkspaces = ["1:terms","2:web","3:coding","4:files","5:media"]
  30.  
  31. myKeys = [ ("M-b", sendMessage ToggleStruts)
  32.         , ("M-e", goToSelected defaultGSConfig)
  33.         , ("M-p", spawn "dmenu_run")
  34.         , ("M-<Right>", nextWS)
  35.         , ("M-<Left>", prevWS)
  36.         , ("M-S-<Right>", shiftToNext)
  37.         , ("M-S-<Left>", shiftToPrev)
  38.         ]
  39.  
  40. myManageHook = (composeAll . concat $
  41.     [ [className =? floats  --> doFloat | floats <- myFloats]
  42.     , [className =? webs    --> doF (S.shift "2:web") | webs <-myWebShifts]
  43.     , [className =? coding  --> doF (S.shift "3:coding") | coding <- myCodingShifts]
  44.     , [className =? files   --> doF (S.shift "4:files") | files <- myFileShifts]
  45.     , [className =? media   --> doF (S.shift "5:media") | media <- myMediaShifts]
  46.     , [className =? "stalonetray"        --> doIgnore]
  47.     , [resource  =? "desktop_window"     --> doIgnore]
  48.     , [resource  =? "kdesktop"           --> doIgnore]
  49.     ])
  50.     where
  51.         myFloats = ["Gimp", "MPlayer", "Pidgin", "Transmission-gtk"]
  52.         myWebShifts = ["Chromium", "Firefox"]
  53.         myCodingShifts = ["Gimp", "Leafpad", "Texmaker"]
  54.         myFileShifts = ["File-roller" ,"Okular", "Thunar", "Transmission-gtk", "Zathura"]
  55.         myMediaShifts = ["MPlayer", "Pidgin"]
  56. --- }}}
  57.  
  58. --- Taskbars {{{
  59. myDzenPP h = defaultPP
  60.     { ppCurrent         = dzenColor myFFGColor myFBGColor . wrap (" ^fg(" ++ myFFGColor ++ ")^i(" ++ myIconDir ++ "/xbm8x8/eye_l.xbm)" ++ " ^fg(" ++ myFFGColor ++ ")") " "
  61.     , ppVisible         = dzenColor myVFGColor myVBGColor . wrap (" ^fg(" ++ myVFGColor ++ ")^i(" ++ myIconDir ++ "/xbm8x8/eye_r.xbm)" ++ " ^fg(" ++ myVFGColor ++ ")") " "
  62.     , ppHidden          = dzenColor myDFGColor myDBGColor . wrap (" ^i(" ++ myIconDir ++ "/dzen_bitmaps/has_win.xbm) ") " "
  63.     , ppHiddenNoWindows = dzenColor myDFGColor myDBGColor . wrap (" ^i(" ++ myIconDir ++ "/dzen_bitmaps/has_win_nv.xbm) ") " "
  64.     , ppUrgent          = dzenColor myUFGColor myUBGColor . wrap (" ^i(" ++ myIconDir ++ "/xbm8x8/info_03.xbm) ") " " . dzenStrip
  65.     , ppWsSep           = ""
  66.     , ppSep             = " | "
  67.     , ppLayout          = dzenColor myDFGColor myDBGColor .
  68.                           (\x -> case x of
  69.                           "Full"            -> "^fg(" ++ myDFGColor ++ ")^i(" ++ myIconDir ++ "/dzen_bitmaps/full.xbm)"
  70.                           "Mirror Tall" -> "^fg(" ++ myDFGColor ++ ")^i(" ++ myIconDir ++ "/dzen_bitmaps/mtall.xbm)"
  71.                           "Tall" -> "^fg(" ++ myDFGColor ++ ")^i(" ++ myIconDir ++ "/dzen_bitmaps/tall.xbm)"
  72.                           _                 -> x
  73.                           )
  74.     , ppTitle           = (" " ++) . dzenColor myDFGColor myDBGColor . dzenEscape
  75.     , ppOutput          = hPutStrLn h
  76.     }
  77.  
  78. myDFGColor = "#ffffff" -- normal text color; white
  79. myDBGColor = "#292929" -- normal bg color, black
  80. myFFGColor = myDFGColor -- highlighted bg color, black
  81. myFBGColor = "#DC143C" -- highlighted text color, crimson
  82. myVFGColor = "#8abfb0"
  83. myVBGColor = "#3b848c"
  84. myUFGColor = "#4390B1"
  85. myUBGColor = "#d91e0d"
  86. myIFGColor = "#8abfd0"
  87. myIBGColor = myDBGColor
  88. mySColor   = myDFGColor
  89.  
  90. myStatusBar = "dzen2 -x '0' -y '0' -h '20' -w '1050' -ta 'l' -bg '" ++ myDBGColor ++ "' -fn '" ++ myFont ++ "'"
  91. myTrayBar = "/home/lilith/.xmonad/traybarscript.zsh | dzen2 -x '1050' -y '0' -h '20' -ta 'r' -bg '" ++ myDBGColor ++ "' -fg '" ++ myDFGColor ++ "' -fn '" ++ myFont ++ "'"
  92. myBottomBar = "conky -c /home/lilith/.xmonad/conky_bottom | dzen2 -x '0' -y '880' -h '20' -ta 'c' -bg '" ++ myDBGColor ++ "' -fg '" ++ myDFGColor ++ "' -fn '" ++ myFont ++ "'"
  93. myIconDir = "/home/lilith/.dzen/"
  94.  
  95. myFont = "-*-liberation mono-medium-r-normal-*-10-*-*-*-*-*-*-*"
  96. ---  }}}
  97.  
  98. main = do
  99.     dzen <- spawnPipe myStatusBar
  100.     tray <- spawnPipe myTrayBar
  101.     bottom <- spawnPipe myBottomBar
  102.     programs <- spawnPipe "sh /home/lilith/.xmonad/autostart.sh"
  103.     xmonad $ azertyConfig { borderWidth = myBorderWidth
  104.         , focusedBorderColor = myFocusedBorderColor
  105.         , focusFollowsMouse = myFocusFollowsMouse
  106. --        , keys = \c -> azertyKeys c `M.Union` keys defaultConfig c
  107.         , layoutHook = avoidStruts $ layoutHook azertyConfig
  108.         , logHook = (dynamicLogWithPP $ myDzenPP dzen)
  109.         , handleEventHook = ewmhDesktopsEventHook
  110.         , manageHook = myManageHook <+> manageHook azertyConfig
  111.         , modMask = myModMask
  112.         , startupHook = ewmhDesktopsStartup
  113.         , terminal = myTerminal
  114.         , workspaces = myWorkspaces
  115.     } `additionalKeysP` myKeys
  116. -- vim:foldmethod=marker sw=4 sts=4 ts=4 tw=0 et ai nowrap
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top