aboutsummaryrefslogtreecommitdiffstats
path: root/LayoutHooks.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-08-23 17:45:20 +0200
committerDavid Roundy <droundy@darcs.net>2007-08-23 17:45:20 +0200
commit774dd513b776288720efdf3a407b64bae4bf56ea (patch)
tree893e94c3e79f83047661e43639259b08d30e267c /LayoutHooks.hs
parent2428f7bcb5908e87bff4ee94480804a927270cce (diff)
downloadXMonadContrib-774dd513b776288720efdf3a407b64bae4bf56ea.tar.gz
XMonadContrib-774dd513b776288720efdf3a407b64bae4bf56ea.tar.xz
XMonadContrib-774dd513b776288720efdf3a407b64bae4bf56ea.zip
remove LayoutHooks module (which is unused).
darcs-hash:20070823154520-72aca-d3f47bf132a88cdfa67c901f4cef0b7bd78e6f56.gz
Diffstat (limited to 'LayoutHooks.hs')
-rw-r--r--LayoutHooks.hs44
1 files changed, 0 insertions, 44 deletions
diff --git a/LayoutHooks.hs b/LayoutHooks.hs
deleted file mode 100644
index 9a4a95d..0000000
--- a/LayoutHooks.hs
+++ /dev/null
@@ -1,44 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : XMonadContrib.LayoutHooks
--- Copyright : (c) Stefan O'Rear <stefanor@cox.net>
--- License : BSD
---
--- Maintainer : Stefan O'Rear <stefanor@cox.net>
--- Stability : unstable
--- Portability : portable
---
--- General layout-level hooks.
------------------------------------------------------------------------------
-
-module XMonadContrib.LayoutHooks ( addLayoutMessageHook ) where
-
-import qualified Data.Map as M ( adjust )
-import Control.Arrow ( first )
-import Control.Monad.State ( modify )
-
-import XMonad
-import qualified StackSet as W
-
-install :: (SomeMessage -> X Bool) -> Layout a -> Layout a
-install hk lay = lay{ modifyLayout = mod' }
- where
- mod' msg = do reinst <- hk msg
- nlay <- modifyLayout lay msg
-
- return $ cond_reinst reinst nlay
-
- -- no need to make anything change
- cond_reinst True Nothing = Nothing
- -- reinstall
- cond_reinst True (Just nlay) = Just (install hk nlay)
- -- restore inner layout
- cond_reinst False Nothing = Just lay
- -- let it rot
- cond_reinst False (Just nlay) = Just nlay
-
--- Return True each time you want the hook reinstalled
-addLayoutMessageHook :: (SomeMessage -> X Bool) -> X ()
-addLayoutMessageHook hk = modify $ \ s ->
- let nr = W.tag . W.workspace . W.current . windowset $ s
- in s { layouts = M.adjust (first $ install hk) nr (layouts s) }