]> code.delx.au - dotfiles/blobdiff - .xmonad/xmonad.hs
xmonad: fix full screen flash
[dotfiles] / .xmonad / xmonad.hs
index 49f4046428def884c15c59ff672d0a94a18625bc..08b88e1c46f4431620917d9ecce351509bbdb9e0 100644 (file)
@@ -1,18 +1,22 @@
 import System.IO
 import XMonad
 import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.EwmhDesktops
 import XMonad.Hooks.ICCCMFocus
 import XMonad.Hooks.ManageDocks
 import XMonad.Hooks.Script
-import XMonad.Layout.Grid
 import XMonad.Hooks.SetWMName
 import XMonad.Layout.IM
 import XMonad.Layout.LayoutHints
+import qualified XMonad.Layout.Magnifier as Mag
+import XMonad.Hooks.ManageHelpers
 import XMonad.Layout.NoBorders
 import XMonad.Layout.NoFrillsDecoration
 import XMonad.Layout.PerWorkspace
 import XMonad.Layout.Renamed
 import XMonad.Layout.Tabbed
+import XMonad.Layout.ThreeColumns
+import XMonad.Layout.TwoPane
 import XMonad.Util.Run(spawnPipe)
 import qualified Data.Map as M
 import qualified XMonad.StackSet as W
@@ -44,7 +48,8 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
                ((modm, xK_t ), withFocused $ windows . W.sink),
                ((modm , xK_comma ), sendMessage (IncMasterN 1)),
                ((modm , xK_period), sendMessage (IncMasterN (-1))),
-               ((modm , xK_b ), sendMessage ToggleStruts)
+               ((modm , xK_b ), sendMessage ToggleStruts),
+               ((modm , xK_z ), sendMessage Mag.Toggle)
        ]
        ++
 
@@ -69,6 +74,8 @@ myManageHook = composeAll [
                (className =? "Gnome-fallback-mount-helper" <&&> resource =? "gnome-fallback-mount-helper") --> doFloat,
                (className =? "Gdu-notification-daemon" <&&> resource =? "gdu-notification-daemon") --> doFloat,
                (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat,
+               (className =? "Screenruler" <&&> resource =? "screenruler") --> doFloat,
+               (className =? "Plugin-container" <&&> resource =? "plugin-container") --> doFullFloat,
                manageDocks
        ]
 
@@ -101,35 +108,66 @@ myFullLayout = createLayout "Full" $
 
 myTiledLayout = createLayout "Tall" $
        avoidStruts $
-       Tall nMaster ratioIncrement ratio where
+       Mag.magnifierOff $
+       Tall nMaster ratioIncrement masterRatio
+       where
                nMaster = 1
                ratioIncrement = 3/100
-               ratio = goldenRatio
+               masterRatio = goldenRatio
 
 myTabbedLayout = createLayout "Tab" $
        avoidStruts $
        simpleTabbed
 
+myThreeColLayout = createLayout "ThreeCol" $
+       avoidStruts $
+       Mag.magnifierOff $
+       ThreeCol numMaster resizeDelta masterRatio
+       where
+               resizeDelta = 3/100
+               masterRatio = 4/10
+               numMaster = 1
+
+myTwoPaneLayout = createLayout "TwoPane" $
+       avoidStruts $
+       Mag.magnifierOff $
+       TwoPane resizeDelta masterRatio
+       where
+               resizeDelta = 3/100
+               masterRatio = goldenRatio
+
 myImLayout = createLayout "IM" $
        avoidStruts $
        noFrillsDeco shrinkText defaultTheme $
-       withIM ratio roster $ GridRatio 1
+       withIM rosterRatio roster $
+       myTiledLayout
+---    myThreeColLayout -- use this on wider screens
        where
-               ratio = 1/4
+               rosterRatio = 1/8
                roster = (Or (Title "Buddy List") (And (Resource "main") (ClassName "psi")))
 
+-- This was the easiest way I found to avoid a compile error when I have
+-- an unused layout
+referenceAllLayoutsToAvoidErrors =
+       myFullLayout |||
+       myTiledLayout |||
+       myTabbedLayout |||
+       myThreeColLayout |||
+       myTwoPaneLayout |||
+       myImLayout
+
 
 myLayout =
        (
                onWorkspace "1" (myImLayout) $
                onWorkspace "2" (myTabbedLayout ||| myFullLayout) $
-               (myTiledLayout ||| myTabbedLayout ||| myFullLayout)
+               (myTiledLayout ||| myTabbedLayout)
        )
 
 main = do
        xmonadDir <- getXMonadDir
        xmobar <- spawnPipe ("xmobar " ++ xmonadDir ++ "/xmobar.hs")
-       xmonad $ defaultConfig {
+       xmonad $ ewmh defaultConfig {
                manageHook = myManageHook <+> manageHook defaultConfig,
                layoutHook = myLayout,
                workspaces = myWorkspaces,