add focusUrgent action, for those too lazy to read

This commit is contained in:
Devin Mullins 2007-11-03 05:54:58 +00:00
parent 273f64955e
commit f2eec4b48b

View File

@ -20,11 +20,14 @@ module XMonadContrib.UrgencyHook (
-- * Usage -- * Usage
-- $usage -- $usage
withUrgencyHook, withUrgencyHook,
focusUrgent,
readUrgents, readUrgents,
withUrgents withUrgents
) where ) where
import {-# SOURCE #-} Config (urgencyHook, logHook) import {-# SOURCE #-} Config (urgencyHook, logHook)
import Operations (windows)
import qualified StackSet as W
import XMonad import XMonad
import XMonadContrib.LayoutModifier import XMonadContrib.LayoutModifier
@ -72,6 +75,12 @@ import Foreign (unsafePerformIO)
-- The functions readUrgents and withUrgents are there to help you with that. -- The functions readUrgents and withUrgents are there to help you with that.
-- No example for you. -- No example for you.
-- | Focuses the most recently urgent window. Good for what ails ya -- I mean, your keybindings.
-- Example keybinding:
-- > , ((modMask , xK_BackSpace), focusUrgent)
focusUrgent :: X ()
focusUrgent = withUrgents $ flip whenJust (windows . W.focusWindow) . listToMaybe
-- | Stores the global set of all urgent windows, across workspaces. Not exported -- use -- | Stores the global set of all urgent windows, across workspaces. Not exported -- use
-- @readUrgents@ or @withUrgents@ instead. -- @readUrgents@ or @withUrgents@ instead.
{-# NOINLINE urgents #-} {-# NOINLINE urgents #-}