mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Allow clients of NamedWindows to get at the name.
This commit is contained in:
parent
a1b8a3ba79
commit
1d886ae670
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user