From 4866f2e367dfcf22a9591231ba40948826a1b438 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 1 Nov 2007 21:10:59 +0100 Subject: Hierarchify darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz --- NamedWindows.hs | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 NamedWindows.hs (limited to 'NamedWindows.hs') diff --git a/NamedWindows.hs b/NamedWindows.hs deleted file mode 100644 index 9237255..0000000 --- a/NamedWindows.hs +++ /dev/null @@ -1,57 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : XMonadContrib.NamedWindows --- Copyright : (c) David Roundy --- License : BSD3-style (see LICENSE) --- --- Maintainer : David Roundy --- Stability : unstable --- Portability : unportable --- --- This module allows you to associate the X titles of windows with --- them. --- ------------------------------------------------------------------------------ - -module XMonadContrib.NamedWindows ( - -- * Usage - -- $usage - NamedWindow, - getName, - withNamedWindow, - unName - ) where - -import Control.Monad.Reader ( asks ) -import Control.Monad.State ( gets ) - -import qualified XMonad.StackSet as W ( peek ) - -import Graphics.X11.Xlib -import Graphics.X11.Xlib.Extras - -import XMonad - --- $usage --- See "XMonadContrib.Mosaic" for an example of its use. - - -data NamedWindow = NW !String !Window -instance Eq NamedWindow where - (NW s _) == (NW s' _) = s == s' -instance Ord NamedWindow where - compare (NW s _) (NW s' _) = compare s s' -instance Show NamedWindow where - show (NW n _) = n - -getName :: Window -> X NamedWindow -getName w = asks display >>= \d -> do s <- io $ getClassHint d w - n <- maybe (resName s) id `fmap` io (fetchName d w) - return $ NW n w - -unName :: NamedWindow -> Window -unName (NW _ w) = w - -withNamedWindow :: (NamedWindow -> X ()) -> X () -withNamedWindow f = do ws <- gets windowset - whenJust (W.peek ws) $ \w -> getName w >>= f -- cgit v1.2.3