From f30ad07ff8ded8e9b1362dd78757c10202552cef Mon Sep 17 00:00:00 2001 From: xmonad-contrib Date: Wed, 2 Jan 2008 08:48:10 +0100 Subject: 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 --- XMonad/Hooks/ManageHelpers.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'XMonad/Hooks/ManageHelpers.hs') 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 > 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 -- cgit v1.2.3