3 import XMonad.Hooks.DynamicLog
4 import XMonad.Hooks.ICCCMFocus
5 import XMonad.Hooks.ManageDocks
6 import XMonad.Hooks.Script
7 import XMonad.Hooks.SetWMName
8 import XMonad.Layout.IM
9 import XMonad.Layout.LayoutHints
10 import qualified XMonad.Layout.Magnifier as Mag
11 import XMonad.Layout.NoBorders
12 import XMonad.Layout.NoFrillsDecoration
13 import XMonad.Layout.PerWorkspace
14 import XMonad.Layout.Renamed
15 import XMonad.Layout.Tabbed
16 import XMonad.Layout.ThreeColumns
17 import XMonad.Util.Run(spawnPipe)
18 import qualified Data.Map as M
19 import qualified XMonad.StackSet as W
22 myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
24 ((modm .|. shiftMask, xK_q), spawn "gnome-session-quit"),
25 ((modm .|. shiftMask, xK_h), spawn "gnome-session-quit --power-off"),
26 -- ((modm .|. shiftMask, xK_q), spawn "gnome-session-save --logout-dialog"),
27 -- ((modm .|. shiftMask, xK_h), spawn "gnome-session-save --shutdown-dialog"),
28 ((modm .|. shiftMask, xK_l), spawn "gnome-screensaver-command --lock"),
30 ((modm, xK_n), spawn "gnome-terminal"),
31 ((modm, xK_i), spawn "firefox"),
33 ((modm .|. shiftMask, xK_c ), kill),
34 ((modm, xK_space ), sendMessage NextLayout),
35 ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf),
36 ((modm, xK_Tab ), windows W.focusDown),
37 ((modm, xK_j ), windows W.focusDown),
38 ((modm, xK_k ), windows W.focusUp ),
39 ((modm, xK_m ), windows W.focusMaster ),
40 ((modm, xK_Return), windows W.swapMaster),
41 ((modm .|. shiftMask, xK_j ), windows W.swapDown ),
42 ((modm .|. shiftMask, xK_k ), windows W.swapUp ),
43 ((modm, xK_h ), sendMessage Shrink),
44 ((modm, xK_l ), sendMessage Expand),
45 ((modm, xK_t ), withFocused $ windows . W.sink),
46 ((modm , xK_comma ), sendMessage (IncMasterN 1)),
47 ((modm , xK_period), sendMessage (IncMasterN (-1))),
48 ((modm , xK_b ), sendMessage ToggleStruts),
49 ((modm , xK_z ), sendMessage Mag.Toggle)
53 -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
54 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
55 [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
56 | (key, sc) <- zip [xK_o, xK_e, xK_u] [0..]
57 , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
61 -- mod-[1..9], Switch to workspace N
62 -- mod-shift-[1..9], Move client to workspace N
63 [((m .|. modm, k), windows $ f i)
64 | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
65 , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
70 myManageHook = composeAll [
71 (className =? "Gnome-fallback-mount-helper" <&&> resource =? "gnome-fallback-mount-helper") --> doFloat,
72 (className =? "Gdu-notification-daemon" <&&> resource =? "gdu-notification-daemon") --> doFloat,
73 (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat,
74 (className =? "Screenruler" <&&> resource =? "screenruler") --> doFloat,
79 myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
83 ppTitle = xmobarColor "green" ""
87 dynamicLogWithPP myPP { ppOutput = hPutStrLn h1 } >>
88 takeTopFocus -- fix for Java Swing apps
91 setWMName "LG3D" -- fix for Java Swing apps
94 goldenRatio = (toRational (2/(1+sqrt(5)::Double)))
96 createLayout name layout =
97 renamed [Replace name] $
102 myFullLayout = createLayout "Full" $
105 myTiledLayout = createLayout "Tall" $
108 Tall nMaster ratioIncrement ratio
111 ratioIncrement = 3/100
114 myTabbedLayout = createLayout "Tab" $
118 myThreeColLayout = createLayout "ThreeCol" $
121 ThreeCol numMaster resizeDelta masterRatio
127 myImLayout = createLayout "IM" $
129 noFrillsDeco shrinkText defaultTheme $
130 withIM rosterRatio roster $
132 --- myThreeColLayout -- use this on wider screens
135 roster = (Or (Title "Buddy List") (And (Resource "main") (ClassName "psi")))
137 -- This was the easiest way I found to avoid a compile error when I have
139 referenceAllLayoutsToAvoidErrors =
149 onWorkspace "1" (myImLayout) $
150 onWorkspace "2" (myTabbedLayout ||| myFullLayout) $
151 (myTiledLayout ||| myTabbedLayout)
155 xmonadDir <- getXMonadDir
156 xmobar <- spawnPipe ("xmobar " ++ xmonadDir ++ "/xmobar.hs")
157 xmonad $ defaultConfig {
158 manageHook = myManageHook <+> manageHook defaultConfig,
159 layoutHook = myLayout,
160 workspaces = myWorkspaces,
161 logHook = myLogHook xmobar,
162 startupHook = myStartupHook,