From 1eedc6595237f534b2c64e39abd2298a0dd2bddc Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Sun, 6 Apr 2008 03:20:06 +0200 Subject: XMonad.ManageHook: add 'appName', another name for 'resource' darcs-hash:20080406012006-462cf-4a10582299442b6e035a62f43d13a72666d892a1 --- XMonad/ManageHook.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'XMonad/ManageHook.hs') diff --git a/XMonad/ManageHook.hs b/XMonad/ManageHook.hs index d74f667..485c245 100644 --- a/XMonad/ManageHook.hs +++ b/XMonad/ManageHook.hs @@ -75,12 +75,16 @@ title = ask >>= \w -> liftX $ do io $ bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" -- | Return the application name. +appName :: Query String +appName = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap resName $ io $ getClassHint d w) + +-- | Backwards compatible alias for 'appName'. resource :: Query String -resource = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap resName $ io $ getClassHint d w) +resource = appName -- | Return the resource class. className :: Query String -className = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap resClass $ io $ getClassHint d w) +className = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap resClass $ io $ getClassHint d w) -- | A query that can return an arbitrary X property of type String, -- identified by name. -- cgit v1.2.3