aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2013-09-25 00:47:38 +0200
committerAdam Vogt <vogt.adam@gmail.com>2013-09-25 00:47:38 +0200
commit7827be678f34718d71e987dec905477a6c3d9c7b (patch)
tree9c95fe5b7940f1c9961cc66ff81fc65be49d3f8c /XMonad
parentb3471710e241da543a20c4213f9f69959852140b (diff)
downloadXMonadContrib-7827be678f34718d71e987dec905477a6c3d9c7b.tar.gz
XMonadContrib-7827be678f34718d71e987dec905477a6c3d9c7b.tar.xz
XMonadContrib-7827be678f34718d71e987dec905477a6c3d9c7b.zip
fix UrgencyHook and add filterUrgencyHook
Ignore-this: 3b7c62275701e6758397977c5c09b744 darcs-hash:20130924224738-1499c-ab95229d2c111aa4f438df0a03e2dfd4429a5a55.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Hooks/UrgencyHook.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/XMonad/Hooks/UrgencyHook.hs b/XMonad/Hooks/UrgencyHook.hs
index f2691fc..afc5b16 100644
--- a/XMonad/Hooks/UrgencyHook.hs
+++ b/XMonad/Hooks/UrgencyHook.hs
@@ -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 ()
+