[xmonad] Ignore single window for focus follows mouse?

Joseph Garvin joseph.h.garvin at gmail.com
Wed Dec 7 05:04:09 CET 2011


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 <wirtwolff at gmail.com> wrote:

> 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
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20111206/2914eb7f/attachment.htm>


More information about the xmonad mailing list