diff options
author | Ismael Carnales <icarnales@gmail.com> | 2009-02-05 02:30:31 +0100 |
---|---|---|
committer | Ismael Carnales <icarnales@gmail.com> | 2009-02-05 02:30:31 +0100 |
commit | 6dde16269006a318e1a1ef5a5ff6d089854db6d2 (patch) | |
tree | dceb4fbb8a2ef997116afe3b58a89749b59f76ea /XMonad/Util | |
parent | 2dac4c38e43815dbfa59fb4e810f3379a5ee8842 (diff) | |
download | XMonadContrib-6dde16269006a318e1a1ef5a5ff6d089854db6d2.tar.gz XMonadContrib-6dde16269006a318e1a1ef5a5ff6d089854db6d2.tar.xz XMonadContrib-6dde16269006a318e1a1ef5a5ff6d089854db6d2.zip |
X.U.WindowProperties: Add getProp32 and getProp32s, helpers to get properties from windows
Ignore-this: c5481fd5d97b15ca049e2da2605f65c1
darcs-hash:20090205013031-6553f-d106b609838d4ccf3fe4afa448910b897cd5b87c.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r-- | XMonad/Util/WindowProperties.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/XMonad/Util/WindowProperties.hs b/XMonad/Util/WindowProperties.hs index d6282b1..c09efd1 100644 --- a/XMonad/Util/WindowProperties.hs +++ b/XMonad/Util/WindowProperties.hs @@ -15,10 +15,12 @@ module XMonad.Util.WindowProperties ( -- * Usage -- $usage Property(..), hasProperty, focusedHasProperty, allWithProperty, + getProp32, getProp32s, propertyToQuery) where import XMonad import qualified XMonad.StackSet as W +import Foreign.C.Types (CLong) import Control.Monad -- $usage @@ -78,3 +80,11 @@ propertyToQuery (And p1 p2) = propertyToQuery p1 <&&> propertyToQuery p2 propertyToQuery (Or p1 p2) = propertyToQuery p1 <||> propertyToQuery p2 propertyToQuery (Not p) = not `fmap` propertyToQuery p propertyToQuery (Const b) = return b + +-- | Get a window property from atom +getProp32 :: Atom -> Window -> X (Maybe [CLong]) +getProp32 a w = withDisplay $ \dpy -> io $ getWindowProperty32 dpy a w + +-- | Get a window property from string +getProp32s :: String -> Window -> X (Maybe [CLong]) +getProp32s str w = do { a <- getAtom str; getProp32 a w } |