mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-08 16:01:53 -07:00
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.
This commit is contained in:
@@ -57,7 +57,7 @@ module XMonad.Hooks.UrgencyHook (
|
|||||||
dzenUrgencyHook,
|
dzenUrgencyHook,
|
||||||
DzenUrgencyHook(..), seconds,
|
DzenUrgencyHook(..), seconds,
|
||||||
NoUrgencyHook(..),
|
NoUrgencyHook(..),
|
||||||
|
FocusHook(..),
|
||||||
-- * Stuff for developers:
|
-- * Stuff for developers:
|
||||||
readUrgents, withUrgents,
|
readUrgents, withUrgents,
|
||||||
StdoutUrgencyHook(..),
|
StdoutUrgencyHook(..),
|
||||||
@@ -338,6 +338,17 @@ instance UrgencyHook DzenUrgencyHook where
|
|||||||
where flash name index =
|
where flash name index =
|
||||||
dzenWithArgs (show name ++ " requests your attention on workspace " ++ index) a d
|
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.
|
-- | 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.
|
-- Defaults to a duration of five seconds, and no extra args to dzen.
|
||||||
-- See 'DzenUrgencyHook'.
|
-- See 'DzenUrgencyHook'.
|
||||||
|
Reference in New Issue
Block a user