aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2007-11-12 02:58:55 +0100
committerDevin Mullins <me@twifkak.com>2007-11-12 02:58:55 +0100
commitd9098a92b64d225bce6eacbe371b61102980bae5 (patch)
treee8c2cdcb130146f0b7fbefe8dc58026790b9b781 /XMonad/Hooks
parent59fde890b1a2446389c772edd7bff8cb895024db (diff)
downloadXMonadContrib-d9098a92b64d225bce6eacbe371b61102980bae5.tar.gz
XMonadContrib-d9098a92b64d225bce6eacbe371b61102980bae5.tar.xz
XMonadContrib-d9098a92b64d225bce6eacbe371b61102980bae5.zip
add StdoutUrgencyHook, to help debug weird client behavior
darcs-hash:20071112015855-78224-459555edb4a9acd4a06a1ae1960eb3b9e8a3d6ee.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/UrgencyHook.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/XMonad/Hooks/UrgencyHook.hs b/XMonad/Hooks/UrgencyHook.hs
index 35b460d..567389b 100644
--- a/XMonad/Hooks/UrgencyHook.hs
+++ b/XMonad/Hooks/UrgencyHook.hs
@@ -22,7 +22,7 @@ module XMonad.Hooks.UrgencyHook (
withUrgencyHook,
focusUrgent,
readUrgents, withUrgents,
- NoUrgencyHook(..),
+ NoUrgencyHook(..), StdoutUrgencyHook(..),
dzenUrgencyHook, DzenUrgencyHook(..),
seconds
) where
@@ -104,9 +104,10 @@ instance UrgencyHook h Window => LayoutModifier (WithUrgencyHook h) Window where
-- bothers you, please submit a bug report.
userCode $ urgencyHook theHook w
adjustUrgents (\ws -> if elem w ws then ws else w : ws)
- else
+ else do
-- Remove window from urgents list when client removes urgency status.
-- The client should do this, e.g., when it receives focus.
+ userCode $ nonUrgencyHook theHook w
adjustUrgents (delete w)
-- Call logHook after IORef has been modified.
userCode =<< asks (logHook . config)
@@ -125,7 +126,9 @@ withUrgencyHook :: (UrgencyHook h Window, LayoutClass l Window) =>
withUrgencyHook theHook = ModifiedLayout $ WithUrgencyHook theHook
class (Read h, Show h) => UrgencyHook h a where
- urgencyHook :: h -> a -> X ()
+ urgencyHook, nonUrgencyHook :: h -> a -> X ()
+
+ nonUrgencyHook _ _ = return ()
data NoUrgencyHook = NoUrgencyHook deriving (Read, Show)
@@ -149,3 +152,10 @@ instance UrgencyHook DzenUrgencyHook Window where
-- duration and args to dzen.
dzenUrgencyHook :: DzenUrgencyHook
dzenUrgencyHook = DzenUrgencyHook { duration = (5 `seconds`), args = [] }
+
+-- For debugging purposes, really.
+data StdoutUrgencyHook = StdoutUrgencyHook deriving (Read, Show)
+
+instance UrgencyHook StdoutUrgencyHook Window where
+ urgencyHook _ w = io $ putStrLn $ "Urgent: " ++ show w
+ nonUrgencyHook _ w = io $ putStrLn $ "Not Urgent: " ++ show w