mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 00:20:22 -07:00
Add details to ManageHook.hs docs (#504)
* Add details to ManageHook.hs docs * Link specialised variants in `stringProperty` doc * Fix typo Co-authored-by: Tomáš Janoušek <tomi@nomi.cz> --------- Co-authored-by: Tomáš Janoušek <tomi@nomi.cz>
This commit is contained in:
parent
383e3d6f47
commit
cde1a25bca
@ -64,7 +64,8 @@ x <&&> y = ifM x y (pure False)
|
|||||||
(<||>) :: Monad m => m Bool -> m Bool -> m Bool
|
(<||>) :: Monad m => m Bool -> m Bool -> m Bool
|
||||||
x <||> y = ifM x (pure True) y
|
x <||> y = ifM x (pure True) y
|
||||||
|
|
||||||
-- | Return the window title.
|
-- | Return the window title; i.e., the string returned by @_NET_WM_NAME@,
|
||||||
|
-- or failing that, the string returned by @WM_NAME@.
|
||||||
title :: Query String
|
title :: Query String
|
||||||
title = ask >>= \w -> liftX $ do
|
title = ask >>= \w -> liftX $ do
|
||||||
d <- asks display
|
d <- asks display
|
||||||
@ -91,7 +92,9 @@ 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',
|
-- | A query that can return an arbitrary X property of type 'String',
|
||||||
-- identified by name.
|
-- identified by name. Works for ASCII strings only. For the properties
|
||||||
|
-- @_NET_WM_NAME@/@WM_NAME@ and @WM_CLASS@ the specialised variants 'title'
|
||||||
|
-- and 'appName'/'className' are preferred.
|
||||||
stringProperty :: String -> Query String
|
stringProperty :: String -> Query String
|
||||||
stringProperty p = ask >>= (\w -> liftX $ withDisplay $ \d -> fromMaybe "" <$> getStringProperty d w p)
|
stringProperty p = ask >>= (\w -> liftX $ withDisplay $ \d -> fromMaybe "" <$> getStringProperty d w p)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user