]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - xmonad.hs
xmonad.hs: Use improved layout.
[config/dotfiles.git] / xmonad.hs
1 -- Xmonad configuration file.
2
3
4 import XMonad
5 -- Necessary for reflectVert.
6 import XMonad.Layout.Reflect
7 -- Necessary for avoidMaster.
8 import qualified XMonad.StackSet as W
9
10
11 -- Prevent new windows from spawning in the master pane. Taken from
12 -- http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions on
13 -- 2009-06-30. Thanks.
14 avoidMaster :: W.StackSet i l a s sd -> W.StackSet i l a s sd
15 avoidMaster = W.modify' $ \c -> case c of
16     W.Stack t [] (r:rs) -> W.Stack t [r] rs
17     otherwise           -> c
18
19 -- Create my custom layout.
20 --
21 -- Only use horizontal (Mirror tiled) and fullscreen layouts.
22 --
23 -- The master pane is at the bottom of the screen (reflectVert). To make sure
24 -- new windows don't spawn in the master pane avoidMaster (see below) is used.
25 --
26 -- Thanks to jrick in #xmonad on Freenode (2009-06-29 22:19) for telling me
27 -- how to remove the vertical tiled layout.
28 myLayoutHook = reflectVert $ Mirror tiled ||| Full
29     where
30     -- Default tiling algorithm partitions the screen into two panes.
31     tiled   = Tall nmaster delta ratio
32     -- The default number of windows in the master pane.
33     nmaster = 1
34     -- Default proportion of screen occupied by master pane.
35     ratio   = 1/2
36     -- Percent of screen to increment by when resizing panes.
37     delta   = 3/100
38
39 -- Don't spawn new windows in the master pane (which is now at the bottom of
40 -- the screen). Thanks to dschoepe, aavogt and especially vav in #xmonad on
41 -- Freenode (2009-06-30 02:10f).
42 myManageHook = doF avoidMaster
43
44 main = xmonad $ defaultConfig
45     -- Use Windows key as main key so it doesn't conflict with any other key
46     -- bindings.
47     { modMask = mod4Mask
48     -- Inactive borders are black - invisible on my black screen.
49     , normalBorderColor = "#000000"
50     -- Active border is dark red.
51     , focusedBorderColor = "#990000"
52     -- Use my layout and manage hooks (see above).
53     , layoutHook = myLayoutHook
54     , manageHook = myManageHook
55     }