summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xmonad.hs30
1 files changed, 28 insertions, 2 deletions
diff --git a/xmonad.hs b/xmonad.hs
index 55868b8..9d21184 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -31,6 +31,7 @@ modm = mod4Mask
main = xmonad $ ewmh $ defaultConfig
{ modMask = modm
, manageHook = myManageHook
+ , unmanageHook = myUnmanageHook
, layoutHook = desktopLayoutModifiers myLayoutHook
, startupHook = myStartupHook
, handleEventHook = myEventHook
@@ -108,10 +109,32 @@ myStartupHook = do
isUtility :: Query Bool
isUtility = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_UTILITY"
+stackHook :: (Window -> W.Stack Window -> W.Stack Window) -> ManageHook
+stackHook f = ask >>= \w -> doF $ \s -> s { W.current = mapScreen w (W.current s)
+ , W.visible = map (mapScreen w) (W.visible s)
+ , W.hidden = map (mapWorkspace w) (W.hidden s)
+ }
+ where
+ mapWorkspace w ws = ws { W.stack = fmap (f w) $ W.stack ws }
+ mapScreen w scr = scr { W.workspace = mapWorkspace w (W.workspace scr) }
+
+moveDown1 :: ManageHook
+moveDown1 = stackHook down
+ where
+ down w (W.Stack c u (d:dx)) | c == w = W.Stack c (d:u) dx
+ down _ stack = stack
+
+moveUp1 :: ManageHook
+moveUp1 = stackHook up
+ where
+ up w (W.Stack c (u:ux) d) | c == w = W.Stack c ux (u:d)
+ up _ stack = stack
+
myManageHook :: ManageHook
myManageHook = composeAll
- [ isDialog --> doFloat
+ [ moveDown1
+ , isDialog --> doFloat
, composeOne
[ className =? "Guake.py" -?> doFloatMaybeFullscreen -- <+> doConfigBorderOff)
--, className =? "Do" -?> (doFloat <+> doConfigBorderOff)
@@ -129,7 +152,10 @@ myManageHook = composeAll
, isUtility =? False --> doAutoShift
, manageHook desktopConfig
]
-
+
+myUnmanageHook :: ManageHook
+myUnmanageHook = moveUp1
+
myLayoutHook = processWorkspaceManager $ manageFullscreen $ smartBorders (Full ||| tiled ||| Mirror tiled)
where