From 4db33f6d9801259f94294044b427cb9c76ae0b45 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 12 Mar 2007 02:23:50 +0100 Subject: comments, move isRoot into XMonad darcs-hash:20070312012350-9c5c1-1753dcb9d066d8954fe5d2f2ed8f5d06a6f976aa.gz --- XMonad.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index 8e03d78..24c7899 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -15,7 +15,9 @@ -- module XMonad ( - X, WorkSpace, XState(..),runX, withDisplay, io, spawn, trace, whenJust + X, WorkSpace, XState(..),runX, + io, withDisplay, isRoot, + spawn, trace, whenJust ) where import StackSet (StackSet) @@ -49,11 +51,19 @@ newtype X a = X (StateT XState IO a) runX :: XState -> X a -> IO () runX st (X a) = runStateT a st >> return () +-- --------------------------------------------------------------------- +-- Convenient wrappers to state + -- | Run a monad action with the current display settings withDisplay :: (Display -> X ()) -> X () withDisplay f = gets display >>= f ------------------------------------------------------------------------- +-- | True if the given window is the root window +isRoot :: Window -> X Bool +isRoot w = liftM (w==) (gets theRoot) + +-- --------------------------------------------------------------------- +-- Utilities -- | Lift an IO action into the X monad io :: IO a -> X a -- cgit v1.2.3