aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks/ManageDocks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/Hooks/ManageDocks.hs')
-rw-r--r--XMonad/Hooks/ManageDocks.hs19
1 files changed, 17 insertions, 2 deletions
diff --git a/XMonad/Hooks/ManageDocks.hs b/XMonad/Hooks/ManageDocks.hs
index 4f5554c..82178d5 100644
--- a/XMonad/Hooks/ManageDocks.hs
+++ b/XMonad/Hooks/ManageDocks.hs
@@ -17,7 +17,7 @@
module XMonad.Hooks.ManageDocks (
-- * Usage
-- $usage
- manageDocks, AvoidStruts, avoidStruts, ToggleStruts(..),
+ manageDocks, AvoidStruts, avoidStruts, avoidStrutsOn, ToggleStruts(..),
Side(..)
) where
@@ -60,6 +60,12 @@ import Data.List (delete)
-- Similarly, you can use 'BB', 'LL', and 'RR' to individually toggle
-- gaps on the bottom, left, or right.
--
+-- If you want certain docks to be avoided but others to be covered by
+-- default, you can manually specify the sides of the screen on which
+-- docks should be avoided, using 'avoidStrutsOn'. For example:
+--
+-- > layoutHook = avoidStrutsOn [TT,LL] (tall ||| mirror tall ||| ...)
+--
-- /Important note/: if you are switching from manual gaps
-- (defaultGaps in your config) to avoidStruts (recommended, since
-- manual gaps will probably be phased out soon), be sure to switch
@@ -133,7 +139,16 @@ calcGap ss = withDisplay $ \dpy -> do
-- | Adjust layout automagically.
avoidStruts :: LayoutClass l a => l a -> ModifiedLayout AvoidStruts l a
-avoidStruts = ModifiedLayout (AvoidStruts [TT,BB,LL,RR])
+avoidStruts = avoidStrutsOn [TT,BB,LL,RR]
+
+-- | Adjust layout automagically: don't cover up docks, status bars,
+-- etc. on the indicated sides of the screen. Valid sides are TT
+-- (top), BB (bottom), RR (right), or LL (left).
+avoidStrutsOn :: LayoutClass l a =>
+ [Side]
+ -> l a
+ -> ModifiedLayout AvoidStruts l a
+avoidStrutsOn ss = ModifiedLayout (AvoidStruts ss)
data AvoidStruts a = AvoidStruts [Side] deriving ( Read, Show )