Advertisement
Guest User

Untitled

a guest
Oct 5th, 2009
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.81 KB | None | 0 0
  1. eric@dystopia ~ $ ghc-pkg check
  2. eric@dystopia ~ $ ghc-pkg list xmonad
  3. /usr/lib64/ghc-6.8.2/package.conf:
  4. xmonad-0.8.1
  5. /home/eric/.ghc/x86_64-linux-6.8.2/package.conf:
  6. xmonad-0.8.1
  7. eric@dystopia ~ $ ghc-pkg list xmonad-contrib
  8. /usr/lib64/ghc-6.8.2/package.conf:
  9. xmonad-contrib-0.8.1
  10. /home/eric/.ghc/x86_64-linux-6.8.2/package.conf:
  11. eric@dystopia ~ $ cat ~/.xmonad/xmonad.hs
  12. --
  13. -- xmonad example config file.
  14. --
  15. -- A template showing all available configuration hooks,
  16. -- and how to override the defaults in your own xmonad.hs conf file.
  17. --
  18. -- Normally, you'd only override those defaults you care about.
  19. --
  20.  
  21. import XMonad
  22. import System.Exit
  23.  
  24. import XMonad.Operations
  25. import qualified XMonad.StackSet as W
  26. import qualified Data.Map as M
  27.  
  28. -- The preferred terminal program, which is used in a binding below and by
  29. -- certain contrib modules.
  30. --
  31. myTerminal = "xterm"
  32.  
  33. -- Width of the window border in pixels.
  34. --
  35. myBorderWidth = 1
  36.  
  37. -- modMask lets you specify which modkey you want to use. The default
  38. -- is mod1Mask ("left alt"). You may also consider using mod3Mask
  39. -- ("right alt"), which does not conflict with emacs keybindings. The
  40. -- "windows key" is usually mod4Mask.
  41. --
  42. myModMask = mod1Mask
  43.  
  44. -- The mask for the numlock key. Numlock status is "masked" from the
  45. -- current modifier status, so the keybindings will work with numlock on or
  46. -- off. You may need to change this on some systems.
  47. --
  48. -- You can find the numlock modifier by running "xmodmap" and looking for a
  49. -- modifier with Num_Lock bound to it:
  50. --
  51. -- > $ xmodmap | grep Num
  52. -- > mod2 Num_Lock (0x4d)
  53. --
  54. -- Set numlockMask = 0 if you don't have a numlock key, or want to treat
  55. -- numlock status separately.
  56. --
  57. myNumlockMask = mod2Mask
  58.  
  59. -- The default number of workspaces (virtual screens) and their names.
  60. -- By default we use numeric strings, but any string may be used as a
  61. -- workspace name. The number of workspaces is determined by the length
  62. -- of this list.
  63. --
  64. -- A tagging example:
  65. --
  66. -- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
  67. --
  68. myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
  69.  
  70. -- Border colors for unfocused and focused windows, respectively.
  71. --
  72. myNormalBorderColor = "#dddddd"
  73. myFocusedBorderColor = "#ff0000"
  74.  
  75. ------------------------------------------------------------------------
  76. -- Key bindings. Add, modify or remove key bindings here.
  77. --
  78. myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
  79.  
  80. -- launch a terminal
  81. [ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
  82.  
  83. -- launch dmenu
  84. , ((modMask, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
  85.  
  86. -- launch gmrun
  87. , ((modMask .|. shiftMask, xK_p ), spawn "gmrun")
  88.  
  89. -- close focused window
  90. , ((modMask .|. shiftMask, xK_c ), kill)
  91.  
  92. -- Rotate through the available layout algorithms
  93. , ((modMask, xK_space ), sendMessage NextLayout)
  94.  
  95. -- Reset the layouts on the current workspace to default
  96. , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
  97.  
  98. -- Resize viewed windows to the correct size
  99. , ((modMask, xK_n ), refresh)
  100.  
  101. -- Move focus to the next window
  102. , ((modMask, xK_Tab ), windows W.focusDown)
  103.  
  104. -- Move focus to the next window
  105. , ((modMask, xK_j ), windows W.focusDown)
  106.  
  107. -- Move focus to the previous window
  108. , ((modMask, xK_k ), windows W.focusUp )
  109.  
  110. -- Move focus to the master window
  111. , ((modMask, xK_m ), windows W.focusMaster )
  112.  
  113. -- Swap the focused window and the master window
  114. , ((modMask, xK_Return), windows W.swapMaster)
  115.  
  116. -- Swap the focused window with the next window
  117. , ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
  118.  
  119. -- Swap the focused window with the previous window
  120. , ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
  121.  
  122. -- Shrink the master area
  123. , ((modMask, xK_h ), sendMessage Shrink)
  124.  
  125. -- Expand the master area
  126. , ((modMask, xK_l ), sendMessage Expand)
  127.  
  128. -- Push window back into tiling
  129. , ((modMask, xK_t ), withFocused $ windows . W.sink)
  130.  
  131. -- Increment the number of windows in the master area
  132. , ((modMask , xK_comma ), sendMessage (IncMasterN 1))
  133.  
  134. -- Deincrement the number of windows in the master area
  135. , ((modMask , xK_period), sendMessage (IncMasterN (-1)))
  136.  
  137. -- toggle the status bar gap
  138. -- TODO, update this binding with avoidStruts , ((modMask , xK_b ),
  139.  
  140. -- Quit xmonad
  141. , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
  142.  
  143. -- Restart xmonad
  144. , ((modMask , xK_q ), restart "xmonad" True)
  145. ]
  146. ++
  147.  
  148. --
  149. -- mod-[1..9], Switch to workspace N
  150. -- mod-shift-[1..9], Move client to workspace N
  151. --
  152. [((m .|. modMask, k), windows $ f i)
  153. | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
  154. , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
  155. ++
  156.  
  157. --
  158. -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
  159. -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
  160. --
  161. [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
  162. | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
  163. , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
  164.  
  165.  
  166. ------------------------------------------------------------------------
  167. -- Mouse bindings: default actions bound to mouse events
  168. --
  169. myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
  170.  
  171. -- mod-button1, Set the window to floating mode and move by dragging
  172. [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
  173.  
  174. -- mod-button2, Raise the window to the top of the stack
  175. , ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
  176.  
  177. -- mod-button3, Set the window to floating mode and resize by dragging
  178. , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
  179.  
  180. -- you may also bind events to the mouse scroll wheel (button4 and button5)
  181. ]
  182.  
  183. ------------------------------------------------------------------------
  184. -- Layouts:
  185.  
  186. -- You can specify and transform your layouts by modifying these values.
  187. -- If you change layout bindings be sure to use 'mod-shift-space' after
  188. -- restarting (with 'mod-q') to reset your layout state to the new
  189. -- defaults, as xmonad preserves your old layout settings by default.
  190. --
  191. -- The available layouts. Note that each layout is separated by |||,
  192. -- which denotes layout choice.
  193. --
  194. myLayout = tiled ||| Mirror tiled ||| Full
  195. where
  196. -- default tiling algorithm partitions the screen into two panes
  197. tiled = Tall nmaster delta ratio
  198.  
  199. -- The default number of windows in the master pane
  200. nmaster = 1
  201.  
  202. -- Default proportion of screen occupied by master pane
  203. ratio = 1/2
  204.  
  205. -- Percent of screen to increment by when resizing panes
  206. delta = 3/100
  207.  
  208. ------------------------------------------------------------------------
  209. -- Window rules:
  210.  
  211. -- Execute arbitrary actions and WindowSet manipulations when managing
  212. -- a new window. You can use this to, for example, always float a
  213. -- particular program, or have a client always appear on a particular
  214. -- workspace.
  215. --
  216. -- To find the property name associated with a program, use
  217. -- > xprop | grep WM_CLASS
  218. -- and click on the client you're interested in.
  219. --
  220. -- To match on the WM_NAME, you can use 'title' in the same way that
  221. -- 'className' and 'resource' are used below.
  222. --
  223. myManageHook = composeAll
  224. [ className =? "MPlayer" --> doFloat
  225. , className =? "Gimp" --> doFloat
  226. , resource =? "desktop_window" --> doIgnore
  227. , resource =? "kdesktop" --> doIgnore ]
  228.  
  229. -- Whether focus follows the mouse pointer.
  230. myFocusFollowsMouse :: Bool
  231. myFocusFollowsMouse = True
  232.  
  233.  
  234. ------------------------------------------------------------------------
  235. -- Status bars and logging
  236.  
  237. -- Perform an arbitrary action on each internal state change or X event.
  238. -- See the 'DynamicLog' extension for examples.
  239. --
  240. -- To emulate dwm's status bar
  241. --
  242. -- > logHook = dynamicLogDzen
  243. --
  244. myLogHook = return ()
  245.  
  246. ------------------------------------------------------------------------
  247. -- Startup hook
  248.  
  249. -- Perform an arbitrary action each time xmonad starts or is restarted
  250. -- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
  251. -- per-workspace layout choices.
  252. --
  253. -- By default, do nothing.
  254. myStartupHook = return ()
  255.  
  256. ------------------------------------------------------------------------
  257. -- Now run xmonad with all the defaults we set up.
  258.  
  259. -- Run xmonad with the settings you specify. No need to modify this.
  260. --
  261. main = xmonad defaults
  262.  
  263. -- A structure containing your configuration settings, overriding
  264. -- fields in the default config. Any you don't override, will
  265. -- use the defaults defined in xmonad/XMonad/Config.hs
  266. --
  267. -- No need to modify this.
  268. --
  269. defaults = defaultConfig {
  270. -- simple stuff
  271. terminal = myTerminal,
  272. focusFollowsMouse = myFocusFollowsMouse,
  273. borderWidth = myBorderWidth,
  274. modMask = myModMask,
  275. numlockMask = myNumlockMask,
  276. workspaces = myWorkspaces,
  277. normalBorderColor = myNormalBorderColor,
  278. focusedBorderColor = myFocusedBorderColor,
  279.  
  280. -- key bindings
  281. keys = myKeys,
  282. mouseBindings = myMouseBindings,
  283.  
  284. -- hooks, layouts
  285. layoutHook = myLayout,
  286. manageHook = myManageHook,
  287. logHook = myLogHook,
  288. startupHook = myStartupHook
  289. }
  290. eric@dystopia ~ $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement