add-willhook-function

Adds a function that hooks into whether the hook will be triggered on the next
request.
This commit is contained in:
Ben Boeckel 2011-05-15 19:17:18 +00:00
parent f4dd8973b1
commit 4377e75bcc

View File

@ -26,6 +26,7 @@ module XMonad.Hooks.ToggleHook ( -- * Usage
, toggleHookAllNew
-- * Queries
, willHook
, willHookNext
, willHookAllNew
@ -127,6 +128,10 @@ hookAllNew n = _set n second
toggleHookAllNew :: String -> X ()
toggleHookAllNew n = _toggle n second
-- | Query what will happen at the next ManageHook call for the hook @name@.
willHook :: String -> X Bool
willHook n = willHookNext n <||> willHookAllNew n
-- | Whether the next window will trigger the hook @name@.
willHookNext :: String -> X Bool
willHookNext n = _get n fst