aboutsummaryrefslogtreecommitdiffstats
path: root/WMonad.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WMonad.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/WMonad.hs b/WMonad.hs
index 2851da2..e059066 100644
--- a/WMonad.hs
+++ b/WMonad.hs
@@ -67,6 +67,18 @@ trace msg = io $ do
hPutStrLn stderr msg
hFlush stderr
+-- | Run a monad action with the current display settings
+withDisplay :: (Display -> W ()) -> W ()
+withDisplay f = gets display >>= f
+
+-- | Run a monadic action with the display, screen width and height
+withScreen :: ((Display,Int,Int) -> W ()) -> W ()
+withScreen f = do
+ d <- gets display
+ sw <- gets screenWidth
+ sh <- gets screenHeight
+ f (d,sw,sh)
+
-- | Modify the workspace list.
modifyWorkspace :: (WorkSpace -> WorkSpace) -> W ()
modifyWorkspace f = do