Actions on window alerts?

Is there a way in xmonad to have actions in response to a window being 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.

On Sun, Feb 8, 2009 at 9:32 PM, Joseph Garvin
Is there a way in xmonad to have actions in response to a window being 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.
Sounds like you want something from XMonad.Hooks.UrgencyHook -- gwern

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, -- wmw

On Sun, Feb 8, 2009 at 10:57 PM, Wirt Wolff
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

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
On Sun, Feb 8, 2009 at 10:57 PM, Wirt Wolff
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@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

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
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
wrote: On Sun, Feb 8, 2009 at 10:57 PM, Wirt Wolff
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@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (3)
-
Gwern Branwen
-
Joseph Garvin
-
Wirt Wolff