aboutsummaryrefslogtreecommitdiffstats
path: root/NamedWindows.hs
diff options
context:
space:
mode:
Diffstat (limited to 'NamedWindows.hs')
-rw-r--r--NamedWindows.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/NamedWindows.hs b/NamedWindows.hs
index 71f8fe9..307c407 100644
--- a/NamedWindows.hs
+++ b/NamedWindows.hs
@@ -1,4 +1,4 @@
-module XMonadContrib.NamedWindows ( NamedWindow, getName, withNamedWindow, unName ) where
+module XMonadContrib.NamedWindows ( NamedWindow, getName, withNamedWindow, unName, name ) where
-- This module allows you to associate the X titles of windows with
-- them. See XMonadContrib.Mosaic for an example of its use.
@@ -26,6 +26,9 @@ getName w = asks display >>= \d -> do n <- maybe "" id `fmap` io (fetchName d w)
unName :: NamedWindow -> Window
unName (NW _ w) = w
+name :: NamedWindow -> String
+name (NW n _) = n
+
withNamedWindow :: (NamedWindow -> X ()) -> X ()
withNamedWindow f = do ws <- gets windowset
whenJust (W.peek ws) $ \w -> getName w >>= f