[xmonad] Actions on window alerts?

Joseph Garvin joseph.h.garvin at gmail.com
Mon Feb 9 00:06:33 EST 2009

I tried with the keyboard instead of the mouse, and switching focus
causes the window that was moved to become floating for some reason.
Then switching to the desktop it was originally on moves it there with
no flicker.

On Mon, Feb 9, 2009 at 12:03 AM, Joseph Garvin
<joseph.h.garvin at gmail.com> wrote:
> This is what I ended up adding to my xmonad.hs:
> -- For moving pidgin windows that want attention to my current desktop
> import XMonad.Hooks.UrgencyHook
> import XMonad.Actions.WindowBringer
> data MoveUrgency = MoveUrgency deriving (Read, Show)
> instance UrgencyHook MoveUrgency where
>    urgencyHook MoveUrgency w = windows (bringWindow w)
> It sort of works but:
> -As soon as I move my mouse over another window, there's a ton of
> flickering, xmonad is going crazy, and I have to switch to the old
> desktop, which makes the window that was moved stay there, back on its
> original desktop.
> -It steals focus, I might be typing something.
> -It becomes master, I'd prefer it come in at the bottom of the stack
> instead of the top.
> Any idea how to fix any of those?
> On Sun, Feb 8, 2009 at 11:15 PM, Gwern Branwen <gwern0 at gmail.com> wrote:
>> 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
>> _______________________________________________
>> xmonad mailing list
>> xmonad at haskell.org
>> http://www.haskell.org/mailman/listinfo/xmonad

More information about the xmonad mailing list