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 <byorgey@seas.upenn.edu> wrote:
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 <joseph.h.garvin@gmail.com>:
> >
> > >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