mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
fix UrgencyHook and add filterUrgencyHook
This commit is contained in:
parent
075b7d69ed
commit
ab3f5b3d5d
@ -55,12 +55,13 @@ module XMonad.Hooks.UrgencyHook (
|
||||
withUrgencyHook, withUrgencyHookC,
|
||||
UrgencyConfig(..), urgencyConfig,
|
||||
SuppressWhen(..), RemindWhen(..),
|
||||
focusUrgent, clearUrgents, clearUrgency,
|
||||
focusUrgent, clearUrgents,
|
||||
dzenUrgencyHook,
|
||||
DzenUrgencyHook(..),
|
||||
NoUrgencyHook(..),
|
||||
BorderUrgencyHook(..),
|
||||
FocusHook(..),
|
||||
filterUrgencyHook,
|
||||
minutes, seconds,
|
||||
-- * Stuff for developers:
|
||||
readUrgents, withUrgents,
|
||||
@ -528,3 +529,18 @@ data StdoutUrgencyHook = StdoutUrgencyHook deriving (Read, Show)
|
||||
|
||||
instance UrgencyHook StdoutUrgencyHook where
|
||||
urgencyHook _ w = io $ putStrLn $ "Urgent: " ++ show w
|
||||
|
||||
-- | urgencyhook such that windows on certain workspaces
|
||||
-- never get urgency set.
|
||||
--
|
||||
-- Useful for scratchpad workspaces perhaps:
|
||||
--
|
||||
-- > main = xmonad (withUrgencyHook (filterUrgencyHook ["NSP", "SP"]) defaultConfig)
|
||||
filterUrgencyHook :: [WorkspaceId] -> Window -> X ()
|
||||
filterUrgencyHook skips w = do
|
||||
ws <- gets windowset
|
||||
case W.findTag w ws of
|
||||
Just tag -> when (tag `elem` skips)
|
||||
$ adjustUrgents (delete w)
|
||||
_ -> return ()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user