Ignore single window for focus follows mouse?

The FAQ mentions you can set focusFollowsMouse to false to disable it completely, but I'd like to disable focus following the mouse only when moving the mouse over a particular window (the pointer going over any other window should still cause that window to get focus). Is there an easy way to do that?

Quoting Joseph Garvin
The FAQ mentions you can set focusFollowsMouse to false to disable it completely, but I'd like to disable focus following the mouse only when moving the mouse over a particular window (the pointer going over any other window should still cause that window to get focus). Is there an easy way to do that?
Maybe "followOnlyIf" from http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MagicFocus.html will help you. ~d

wagnerdm@seas.upenn.edu [2011.12.05 0948 -0500]:
Quoting Joseph Garvin
: The FAQ mentions you can set focusFollowsMouse to false to disable it completely, but I'd like to disable focus following the mouse only when moving the mouse over a particular window (the pointer going over any other window should still cause that window to get focus). Is there an easy way to do that?
Maybe "followOnlyIf" from http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MagicFocus.html will help you.
Slightly OT: I was reading the original question and thought "well, this is really something esoteric that probably requires a homebrewed solution". So it turns out I was wrong. Wow, I'm impressed! N.

On Mon, Dec 05, 2011 at 12:54:28PM -0400, Norbert Zeh wrote:
wagnerdm@seas.upenn.edu [2011.12.05 0948 -0500]:
Quoting Joseph Garvin
: The FAQ mentions you can set focusFollowsMouse to false to disable it completely, but I'd like to disable focus following the mouse only when moving the mouse over a particular window (the pointer going over any other window should still cause that window to get focus). Is there an easy way to do that?
Maybe "followOnlyIf" from http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MagicFocus.html will help you.
Slightly OT: I was reading the original question and thought "well, this is really something esoteric that probably requires a homebrewed solution". So it turns out I was wrong. Wow, I'm impressed!
I don't think it's that esoteric. I use followOnlyIf for the "inverse" situation: I have focusFollowsMouse off by default, except for Gimp windows where it is enabled. -Brent

I'm close, but I only know how to get the opposite of the functionality I
want. The code below prevents focus on all windows except those with the
name "Call with " but I actually want it to focus on any window except that
one. But ManageHook doesn't define a negation operator, just "=?", so I'm
not sure how to do it (pardon my lack of haskell literacy ;p). Also, what I
really want to do is match the regex ".*Call with.*" but I figured I'd try
to get it working with an exact name first.
In general, when you have a Query Bool, is there a way to get the Bool out
of it so you can do normal operations? I know this is related to how monads
work, but I don't really understand xmonad's architecture yet.
-- Focus follows mouse is annoying for skype
followEventHook event = followOnlyIf (notSkype) event
where notSkype =
runQuery ((stringProperty "WM_NAME") =? "Call with ") (ev_window
event)
On Mon, Dec 5, 2011 at 1:57 PM, Brent Yorgey
On Mon, Dec 05, 2011 at 12:54:28PM -0400, Norbert Zeh wrote:
wagnerdm@seas.upenn.edu [2011.12.05 0948 -0500]:
Quoting Joseph Garvin
: The FAQ mentions you can set focusFollowsMouse to false to disable it completely, but I'd like to disable focus following the mouse only when moving the mouse over a particular window (the pointer going over any other window should still cause that window to get focus). Is there an easy way to do that?
Maybe "followOnlyIf" from
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MagicFocus.html
will help you.
Slightly OT: I was reading the original question and thought "well, this is really something esoteric that probably requires a homebrewed solution". So it turns out I was wrong. Wow, I'm impressed!
I don't think it's that esoteric. I use followOnlyIf for the "inverse" situation: I have focusFollowsMouse off by default, except for Gimp windows where it is enabled.
-Brent
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Tue, Dec 6, 2011 at 18:59, Joseph Garvin
focus on any window except that one. But ManageHook doesn't define a negation operator, just "=?", so I'm not sure how to do it (pardon my lack of haskell literacy ;p). Also, what I really want
(/=?) in XMonad.Hooks.ManageHelpers
In general, when you have a Query Bool, is there a way to get the Bool out of it so you can do normal operations? I know this is related to how monads work, but I don't really understand xmonad's architecture yet.
You can't get stuff out of the monad, but you can lift stuff into it with fmap or liftM (same thing, for historical reasons).
q /=? x = fmap (/= x) q
And in fact (=?) is defined as
q =? x = fmap (== x) q
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

Excerpts from Joseph Garvin's message of Tue Dec 06 16:59:16 -0700 2011:
..... one. But ManageHook doesn't define a negation operator, just "=?", so I'm not sure how to do it (pardon my lack of haskell literacy ;p). Also, what I really want to do is match the regex ".*Call with.*" but I figured I'd try to get it working with an exact name first.
In general, when you have a Query Bool, is there a way to get the Bool out of it so you can do normal operations? I know this is related to how monads work, but I don't really understand xmonad's architecture yet.
-- Focus follows mouse is annoying for skype followEventHook event = followOnlyIf (notSkype) event where notSkype = runQuery ((stringProperty "WM_NAME") =? "Call with ") (ev_window event)
As mentioned in the other reply fmap lifts functions. So to match "Call with" anywhere inside WM_NAME, you can import Data.List to use its isInfixOf test (there are also isPrefixOf and isSuffixOf). Also in ManageHook, `title' is provided for matching WM_NAME. So all in all I think you're after: runQuery (fmap (not . ("Call with" `isInfixOf`)) title) -- wmw

Thanks, below code works perfectly :)
-- Focus follows mouse is annoying for skype, when you mouse over
-- the video window it brings up the buddy list
followEventHook event = followOnlyIf (notSkype) event
where notSkype =
runQuery (fmap (not . ("Call with" `isInfixOf`)) (stringProperty
"WM_NAME")) (ev_window event)
On Tue, Dec 6, 2011 at 9:34 PM, Wirt Wolff
..... one. But ManageHook doesn't define a negation operator, just "=?", so I'm not sure how to do it (pardon my lack of haskell literacy ;p). Also, what I really want to do is match the regex ".*Call with.*" but I figured I'd
Excerpts from Joseph Garvin's message of Tue Dec 06 16:59:16 -0700 2011: try
to get it working with an exact name first.
In general, when you have a Query Bool, is there a way to get the Bool out of it so you can do normal operations? I know this is related to how monads work, but I don't really understand xmonad's architecture yet.
-- Focus follows mouse is annoying for skype followEventHook event = followOnlyIf (notSkype) event where notSkype = runQuery ((stringProperty "WM_NAME") =? "Call with ") (ev_window event)
As mentioned in the other reply fmap lifts functions. So to match "Call with" anywhere inside WM_NAME, you can import Data.List to use its isInfixOf test (there are also isPrefixOf and isSuffixOf). Also in ManageHook, `title' is provided for matching WM_NAME. So all in all I think you're after:
runQuery (fmap (not . ("Call with" `isInfixOf`)) title)
-- wmw
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (6)
-
Brandon Allbery
-
Brent Yorgey
-
Joseph Garvin
-
Norbert Zeh
-
wagnerdm@seas.upenn.edu
-
Wirt Wolff