[xmonad] Actions on window alerts?

Gwern Branwen gwern0 at gmail.com
Sun Feb 8 23:15:22 EST 2009


On Sun, Feb 8, 2009 at 10:57 PM, Wirt Wolff <wirtwolff at gmail.com> wrote:
> Excerpts from joseph.h.garvin's message of Sun Feb 08 19:32:21 -0700 2009:
>> alerted (when it blinks in gnome-panel)? I'd like to have a desktop to
>> toss instant messaging windows onto to disregard them until the person
>> I'm talking to replies (which causes the window to alert if it
>> currently doesn't have focus) at which point I'd like it to move to
>> whatever desktop I happen to be working on so I'll notice it.
>
> AFAICT, Hooks.UrgencyHooks doesn't provide a "bring the window to me"
> function, but perhaps you could define your own instance of UrgencyHook.
>
> import Data.Maybe
> import XMonad.Actions.WindowBringer
> import XMonad.Hooks.UrgencyHook
>
> data BringHook = BringHook deriving (Read, Show)
> instance UrgencyHook BringHook where
>    urgencyHook _ _ = withUrgents $
>            flip whenJust (windows . bringWindow) . listToMaybe
>
> then use something like
>
> myConfig = withUrgencyHook BringHook $ defaultConf {...
>
> pretty sure that should work. type checks in ghci anyway.
>
> regards,

If that works for him, it'd be a worthwhile addition to the module.
IIRC, I came up with & included in the module the reverse
functionality - going *to* a window which set an urgency flag. So it
only makes sense to include bringing the window.

-- 
gwern


More information about the xmonad mailing list