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,
78 myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
82 ppTitle = xmobarColor "green" ""
86 dynamicLogWithPP myPP { ppOutput = hPutStrLn h1 } >>
87 takeTopFocus -- fix for Java Swing apps
90 setWMName "LG3D" -- fix for Java Swing apps
93 goldenRatio = (toRational (2/(1+sqrt(5)::Double)))
95 createLayout name layout =
96 renamed [Replace name] $
101 myFullLayout = createLayout "Full" $
104 myTiledLayout = createLayout "Tall" $
107 Tall nMaster ratioIncrement ratio
110 ratioIncrement = 3/100
113 myTabbedLayout = createLayout "Tab" $
117 myThreeColLayout = createLayout "ThreeCol" $
119 ThreeCol numMaster resizeDelta masterRatio
125 myImLayout = createLayout "IM" $
127 noFrillsDeco shrinkText defaultTheme $
128 withIM rosterRatio roster $
130 --- myThreeColLayout -- use this on wider screens
133 roster = (Or (Title "Buddy List") (And (Resource "main") (ClassName "psi")))
135 -- This was the easiest way I found to avoid a compile error when I have
137 referenceAllLayoutsToAvoidErrors =
147 onWorkspace "1" (myImLayout) $
148 onWorkspace "2" (myTabbedLayout ||| myFullLayout) $
149 (myTiledLayout ||| myTabbedLayout)
153 xmonadDir <- getXMonadDir
154 xmobar <- spawnPipe ("xmobar " ++ xmonadDir ++ "/xmobar.hs")
155 xmonad $ defaultConfig {
156 manageHook = myManageHook <+> manageHook defaultConfig,
157 layoutHook = myLayout,
158 workspaces = myWorkspaces,
159 logHook = myLogHook xmobar,
160 startupHook = myStartupHook,