
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