mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Add 'and' and 'or' functions to ManageHook.
This commit is contained in:
parent
c95b8d9160
commit
1ab1d729a0
@ -49,6 +49,16 @@ p --> f = p >>= \b -> if b then f else mempty
|
|||||||
(=?) :: Eq a => Query a -> a -> Query Bool
|
(=?) :: Eq a => Query a -> a -> Query Bool
|
||||||
q =? x = fmap (== x) q
|
q =? x = fmap (== x) q
|
||||||
|
|
||||||
|
infixr 3 <&&>, <||>
|
||||||
|
|
||||||
|
-- | 'p <&&> q'. '&&' lifted to a Monad.
|
||||||
|
(<&&>) :: Monad m => m Bool -> m Bool -> m Bool
|
||||||
|
(<&&>) = liftM2 (&&)
|
||||||
|
|
||||||
|
-- | 'p <||> q'. '||' lifted to a Monad.
|
||||||
|
(<||>) :: Monad m => m Bool -> m Bool -> m Bool
|
||||||
|
(<||>) = liftM2 (||)
|
||||||
|
|
||||||
-- | Queries that return the window title, resource, or class.
|
-- | Queries that return the window title, resource, or class.
|
||||||
title, resource, className :: Query String
|
title, resource, className :: Query String
|
||||||
title = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap (fromMaybe "") $ io $ fetchName d w)
|
title = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap (fromMaybe "") $ io $ fetchName d w)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user