X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=xmonad.hs;h=467b351f26fc319b68e698ec5935660d2a8e4822;hb=5ed5fe6d5e48875e4d805afb318499afb0c9fc07;hp=76f64d5243ac8973555ca00843e98a8a31d3929d;hpb=2b561d0325948cd6a5ce155805a44723f1c6ede9;p=config%2Fdotfiles.git diff --git a/xmonad.hs b/xmonad.hs index 76f64d5..467b351 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -1,6 +1,6 @@ -- xmonad configuration file. -- --- Should work fine with xmonad 0.7 and above. +-- Tested with xmonad 0.9, most settings should work fine with xmonad 0.7. -- "hiding" necessary for LayoutCombinators. @@ -59,10 +59,11 @@ avoidMaster = W.modify' $ \c -> case c of -- -- The limit layout displays only one window in the lower pane, thanks to to -- Qantourisc (2010-06-12 15:15 CEST) for the hint to use TwoPane. -myLayoutHook = named "Default" (smartBorders $ Mirror tiled) - ||| named "Full" (smartBorders Full) - ||| named "Vertical" (smartBorders tiled) - ||| named "Limit" (smartBorders $ Mirror $ TwoPane delta ratio) +myLayoutHook = + named "Default" (smartBorders $ Mirror tiled) + ||| named "Full" (smartBorders Full) + ||| named "Vertical" (smartBorders tiled) + ||| named "Limit" (smartBorders $ Mirror $ TwoPane delta ratio) where -- Default tiling algorithm partitions the screen into two panes. tiled = Tall nmaster delta ratio @@ -108,16 +109,17 @@ nextLayoutIncluding :: [String] -> X () nextLayoutIncluding layouts = do cws <- gets (W.workspace . W.current . windowset) sendMessageWithNoRefresh NextLayout cws - nextLayoutIncluding' layouts + nextLayoutIncluding' layouts 1000 -- nobody has more than 1000 layouts -nextLayoutIncluding' :: [String] -> X () -nextLayoutIncluding' layouts = do +nextLayoutIncluding' :: [String] -> Int -> X () +nextLayoutIncluding' layouts iterations = do cws <- gets (W.workspace . W.current . windowset) - if not $ (description $ W.layout cws) `elem` layouts + -- iterations prevents an endless loop if no valid layout can be found. + if not ((description $ W.layout cws) `elem` layouts) && iterations > 0 -- Skip over excluded layouts. then do sendMessageWithNoRefresh NextLayout cws - nextLayoutIncluding' layouts + nextLayoutIncluding' layouts (iterations - 1) -- Found allowed layout, show it. else refresh