aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks/UrgencyHook.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-07-17 00:47:45 +0200
committergwern0 <gwern0@gmail.com>2008-07-17 00:47:45 +0200
commita4e48a48bfc8504d759e2964b9184ed762cb4bf0 (patch)
tree1d8db358cce44d8937f6cc962327d41693668d24 /XMonad/Hooks/UrgencyHook.hs
parent892ec2de7654fd1d321d97be443e477d18aa18fa (diff)
downloadXMonadContrib-a4e48a48bfc8504d759e2964b9184ed762cb4bf0.tar.gz
XMonadContrib-a4e48a48bfc8504d759e2964b9184ed762cb4bf0.tar.xz
XMonadContrib-a4e48a48bfc8504d759e2964b9184ed762cb4bf0.zip
XMonad.Hooks.UrgencyHook: +FocusHook
This is a hook for simply traveling to whatever window has just set an urgent flag, instead of doing something more involved like printing to a status bar and letting the user do something manually. darcs-hash:20080716224745-f7719-4fa145f9754e829bea78c89ede58ca01e3187e14.gz
Diffstat (limited to 'XMonad/Hooks/UrgencyHook.hs')
-rw-r--r--XMonad/Hooks/UrgencyHook.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/XMonad/Hooks/UrgencyHook.hs b/XMonad/Hooks/UrgencyHook.hs
index 3c1d1d9..ce7bd3c 100644
--- a/XMonad/Hooks/UrgencyHook.hs
+++ b/XMonad/Hooks/UrgencyHook.hs
@@ -57,7 +57,7 @@ module XMonad.Hooks.UrgencyHook (
dzenUrgencyHook,
DzenUrgencyHook(..), seconds,
NoUrgencyHook(..),
-
+ FocusHook(..),
-- * Stuff for developers:
readUrgents, withUrgents,
StdoutUrgencyHook(..),
@@ -338,6 +338,17 @@ instance UrgencyHook DzenUrgencyHook where
where flash name index =
dzenWithArgs (show name ++ " requests your attention on workspace " ++ index) a d
+{- | A hook which will automatically send you to anything which sets the urgent
+ flag (as opposed to printing some sort of message. You would use this as
+ usual, eg.
+
+ > withUrgencyHook FocusHook $ myconfig { ...
+-}
+data FocusHook = FocusHook deriving (Read, Show)
+
+instance UrgencyHook FocusHook where
+ urgencyHook _ _ = focusUrgent
+
-- | Flashes when a window requests your attention and you can't see it.
-- Defaults to a duration of five seconds, and no extra args to dzen.
-- See 'DzenUrgencyHook'.