From f2eec4b48bd9eac146e8760722876baf604caad6 Mon Sep 17 00:00:00 2001 From: Devin Mullins Date: Sat, 3 Nov 2007 05:54:58 +0000 Subject: [PATCH] add focusUrgent action, for those too lazy to read --- UrgencyHook.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UrgencyHook.hs b/UrgencyHook.hs index 63760f80..e22ee756 100644 --- a/UrgencyHook.hs +++ b/UrgencyHook.hs @@ -20,11 +20,14 @@ module XMonadContrib.UrgencyHook ( -- * Usage -- $usage withUrgencyHook, + focusUrgent, readUrgents, withUrgents ) where import {-# SOURCE #-} Config (urgencyHook, logHook) +import Operations (windows) +import qualified StackSet as W import XMonad import XMonadContrib.LayoutModifier @@ -72,6 +75,12 @@ import Foreign (unsafePerformIO) -- The functions readUrgents and withUrgents are there to help you with that. -- 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 -- @readUrgents@ or @withUrgents@ instead. {-# NOINLINE urgents #-}