aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorredbeard0531 <redbeard0531@gmail.com>2008-03-25 05:04:12 +0100
committerredbeard0531 <redbeard0531@gmail.com>2008-03-25 05:04:12 +0100
commitb40ba3bbabc62f932359993548d10a31a4dc999a (patch)
tree9f51fdf6412cbe08e238210bec138a439fd83b15 /XMonad
parent5de88a2ffb8a8fcff3dab3c7231744c879f99a24 (diff)
downloadXMonadContrib-b40ba3bbabc62f932359993548d10a31a4dc999a.tar.gz
XMonadContrib-b40ba3bbabc62f932359993548d10a31a4dc999a.tar.xz
XMonadContrib-b40ba3bbabc62f932359993548d10a31a4dc999a.zip
focusedHasProperty
darcs-hash:20080325040412-c935a-a165c9d60780822b78ad984fa1a8514d5f64c12b.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Util/WindowProperties.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/XMonad/Util/WindowProperties.hs b/XMonad/Util/WindowProperties.hs
index eb7539c..b1d0055 100644
--- a/XMonad/Util/WindowProperties.hs
+++ b/XMonad/Util/WindowProperties.hs
@@ -14,9 +14,10 @@
module XMonad.Util.WindowProperties (
-- * Usage
-- $usage
- Property(..), hasProperty)
+ Property(..), hasProperty, focusedHasProperty)
where
import XMonad
+import qualified XMonad.StackSet as W
-- $usage
-- This module allows to specify window properties, such as title, classname or
@@ -47,3 +48,12 @@ hasProperty (Or p1 p2) w = do { r1 <- hasProperty p1 w; r2 <- hasProperty p2
hasProperty (Not p1) w = do { r1 <- hasProperty p1 w; return $ not r1 }
hasProperty (Const b) _ = return b
+-- | Does the focused window have this property?
+focusedHasProperty :: Property -> X Bool
+focusedHasProperty p = do
+ ws <- gets windowset
+ let ms = W.stack $ W.workspace $ W.current ws
+ case ms of
+ Just s -> hasProperty p $ W.focus s
+ Nothing -> return False
+