1 -- XMonad configuration file.
3 -- Should work fine with XMonad 0.7 and above.
7 -- Necessary for reflectVert.
8 import XMonad.Layout.Reflect
9 -- Necessary for avoidMaster.
10 import qualified XMonad.StackSet as W
11 -- Necessary for toggleLayouts.
12 import XMonad.Layout.ToggleLayouts
13 -- Necessary for smartBorders.
14 import XMonad.Layout.NoBorders
15 -- Necessary for composeOne and -?>.
16 import XMonad.Hooks.ManageHelpers
17 -- Necessary for `additionalKeys`.
18 import XMonad.Util.EZConfig
21 -- Prevent new windows from spawning in the master pane. Taken from
22 -- http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions on
23 -- 2009-06-30. Thanks. Modified to not steal focus from the master pane when a
24 -- new window is created, thanks to vav in #xmonad on Freenode (2010-04-15
26 avoidMaster :: W.StackSet i l a s sd -> W.StackSet i l a s sd
27 avoidMaster = W.modify' $ \c -> case c of
28 W.Stack t [] (r:rs) -> W.Stack r [] (t:rs)
31 -- Create my custom layout.
33 -- Only use horizontal (Mirror tiled) and fullscreen layouts.
35 -- The master pane is at the top of the screen. To make sure new windows don't
36 -- spawn in the master pane avoidMaster (see below) is used. Borders are only
37 -- drawn when the screen has more then one window (smartBorders).
39 -- Thanks to jrick in #xmonad on Freenode (2009-06-29 22:19) for telling me
40 -- how to remove the vertical tiled layout.
42 -- toggleLayouts is used to allow switching to vertical tiled layout but not
43 -- using it with meta-space (see below in key bindings). Thanks to ml| in
44 -- #xmonad on Freenode (2010-06-14 09:49) how to use toggleLayouts.
45 myLayoutHook = toggleLayouts tiled $ smartBorders $ Mirror tiled ||| Full
47 -- Default tiling algorithm partitions the screen into two panes.
48 tiled = Tall nmaster delta ratio
49 -- The default number of windows in the master pane.
51 -- Percent of screen to increment by when resizing panes.
53 -- Default proportion of screen occupied by master pane.
56 -- Don't spawn new windows in the master pane (which is at the top of the
57 -- screen). Thanks to dschoepe, aavogt and especially vav in #xmonad on
58 -- Freenode (2009-06-30 02:10f).
60 -- Also some applications are spawned on specific workspaces. Thanks to
61 -- dschoepe and ivanm in #xmonad on Freenode (2009-07-12 14:50).
62 myManageHook = composeOne
63 [ className =? "Iceweasel" -?> doF (W.shift "2")
64 , className =? "Wireshark" -?> doF (W.shift "3")
66 -- Don't span new windows in the master pane.
67 , return True -?> doF avoidMaster
68 -- Prevent windows which get moved to other workspaces from removing the
69 -- focus of the currently selected window. Thanks to vav in #xmonad on
70 -- Freenode (2010-04-15 21:04).
71 , return True -?> doF W.focusDown
75 -- Switch to additional layout (vertical tiled) defined by
76 -- toggleLayouts above.
77 ((mod4Mask, xK_v), sendMessage ToggleLayout)
80 -- When using multiple screens, switching to another workspace causes
81 -- Xmonad to pull the workspace to the current screen if it was also
82 -- displayed on another one. This is confusing for me so the following
83 -- code changes it to just switch to the screen where the workspace is
86 -- Thanks to the Xmonad FAQ, read on 2010-06-16 13:42
87 -- (http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions).
88 -- Thanks to MrElendig in #xmonad on Freenode (2010-06-17 17:16) to use
89 -- the default XMonad workspaces.
90 [((m .|. mod4Mask, k), windows $ f i)
91 | (i, k) <- zip (XMonad.workspaces defaultConfig) [xK_1 .. xK_9]
92 , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
94 main = xmonad $ defaultConfig
95 -- Use Windows key as main key so it doesn't conflict with any other key
98 -- Inactive borders are black - invisible on my black screen.
99 , normalBorderColor = "#000000"
100 -- Active border is dark red.
101 , focusedBorderColor = "#990000"
102 -- Use my layout and manage hooks (see above).
103 , layoutHook = myLayoutHook
104 , manageHook = myManageHook
105 -- Use unicode rxvt as my terminal.
108 `additionalKeys` myKeys