aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxmonad-contrib <xmonad-contrib@hexago.nl>2008-01-02 08:48:10 +0100
committerxmonad-contrib <xmonad-contrib@hexago.nl>2008-01-02 08:48:10 +0100
commitf30ad07ff8ded8e9b1362dd78757c10202552cef (patch)
tree5b93186fcc0cd957d9b613d49e8bbdeee97401ff
parenta3d481a9c29e0ab4c57cb9691d937bea24c56b09 (diff)
downloadXMonadContrib-f30ad07ff8ded8e9b1362dd78757c10202552cef.tar.gz
XMonadContrib-f30ad07ff8ded8e9b1362dd78757c10202552cef.tar.xz
XMonadContrib-f30ad07ff8ded8e9b1362dd78757c10202552cef.zip
cleared up transience to better highlight how to use ManageHooks properly
The initial patch that extended the EDSL for writing ManageHook rules did not come with a good example on how to use it. This patch ammends that. 'move' is an example of how to write a rule to resolve a Query (Maybe a) into something tangible. 'move'' is an example of how to write a rule isolating window managing code from the rest ofthe mess the EDSL creates. darcs-hash:20080102074810-cfbce-af71f2a26e887a21a616302407deb42edc31ac6b.gz
-rw-r--r--XMonad/Hooks/ManageHelpers.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/XMonad/Hooks/ManageHelpers.hs b/XMonad/Hooks/ManageHelpers.hs
index a6dcc58..adb7097 100644
--- a/XMonad/Hooks/ManageHelpers.hs
+++ b/XMonad/Hooks/ManageHelpers.hs
@@ -117,11 +117,9 @@ transience :: MaybeManageHook
transience = transientTo </=? Nothing
-?>> move
where move :: Maybe Window -> ManageHook
- move mw = do
- case mw of
- Just w -> do return . Endo $ \s ->
- maybe s (`W.shift` s) (W.findTag w s)
- Nothing -> do return . Endo $ \s -> s
+ move mw = maybe idHook (doF . move') mw
+ where move' :: Window -> (WindowSet -> WindowSet)
+ move' w = \s -> maybe s (`W.shift` s) (W.findTag w s)
-- | 'transience' set to a 'ManageHook'
transience' :: ManageHook