Guest User

Untitled

a guest
Apr 8th, 2011
882
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import XMonad
  2. import XMonad.Config.Gnome
  3. import XMonad.Config.Desktop
  4. import XMonad.Config.Azerty
  5. import XMonad.Util.EZConfig
  6. import XMonad.Util.Run(spawnPipe)
  7. import XMonad.Util.Themes
  8. import XMonad.Util.Scratchpad
  9. import XMonad.Actions.CycleWS
  10. import XMonad.Actions.GridSelect
  11. import XMonad.Actions.UpdatePointer
  12. import XMonad.Hooks.DynamicLog
  13. import XMonad.Layout.NoBorders
  14. import XMonad.Layout.LayoutHints
  15. import XMonad.Layout.DwmStyle
  16. import System.IO
  17. import qualified Data.Map as M
  18. import qualified XMonad.StackSet as W
  19.  
  20. --layout
  21. myLayoutHook = dwmStyle shrinkText (theme xmonadTheme) $ desktopLayoutModifiers $ tiled ||| Mirror tiled ||| Full
  22. where
  23. tiled = Tall nmaster delta ratio
  24. nmaster = 1
  25. ratio = 1/2
  26. delta = 3/100
  27.  
  28. --loghook
  29. myLogHook h = (dynamicLogWithPP $ xmobarPP
  30. { ppOutput = hPutStrLn h
  31. , ppTitle = xmobarColor "green" "" . shorten 50
  32. , ppSort = fmap (.scratchpadFilterOutWorkspace) $ ppSort xmobarPP
  33. }) >> updatePointer (TowardsCentre 1 1)
  34.  
  35. --keymap
  36. myEZKeysP = myEZKeymap (myConfig)
  37. myEZKeymap conf =
  38. [ ("M-i", spawn "firefox")
  39. , ("M-o", spawn "claws-mail")
  40. , ("M-<F2>", spawn $ terminal conf)
  41. , ("M-<F3>", gnomeRun)
  42. , ("M-<KP_Enter>", goToSelected defaultGSConfig)
  43. , ("M-<Backspace>", scratchpadSpawnAction conf ) -- how do I get twosuperior?
  44. ]
  45.  
  46. myEZKeys =
  47. -- [ ((mod4Mask .|. shiftMask, xK_c ), kill)
  48. [
  49. -- additional keys
  50. ]
  51. ++
  52. [((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust (windows . f))
  53. | (key, sc) <- zip [xK_Right, xK_Left] [0..]
  54. , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
  55. ]
  56.  
  57. --managehook
  58. myManageHook = scratchpadManageHook (W.RationalRect 0.125 0.125 0.75 0.75)
  59.  
  60. --workspaces
  61. myWorkspaces = ["www","com","xterm","four","five","six","seven","eight","nine"]
  62.  
  63. --config
  64. myConfig = gnomeConfig
  65. { terminal = "urxvtc"
  66. , modMask = mod4Mask
  67. , focusFollowsMouse = False
  68. , layoutHook = myLayoutHook
  69. , keys = \c -> azertyKeys c `M.union` keys gnomeConfig c
  70. , manageHook = myManageHook <+> manageHook gnomeConfig
  71. , workspaces = myWorkspaces
  72. }
  73. `additionalKeysP` myEZKeysP
  74. `additionalKeys` myEZKeys
  75.  
  76. --main
  77. main=do
  78. xmproc <- spawnPipe "xmobar /home/mike/.xmonad/xmobarrc"
  79. xmonad $ myConfig
  80. { logHook = myLogHook xmproc >> logHook desktopConfig
  81. }
RAW Paste Data