[xmonad] ManageHook question
Brandon S Allbery KF8NH
allbery.b at gmail.com
Sat Mar 5 08:45:30 CET 2011
-----BEGIN PGP SIGNED MESSAGE-----
On 3/5/11 02:28 , Sean Allen wrote:
> title =? 'downloads' --> doIgnore
> but instead of exactly matching title against 'downloads' we want to
> run the doIgnore for any window whose title contains 'downloads'.
It's kinda ugly:
("downloads" `isInfixOf`) `fmap` title --> doIgnore
fmap (isInfixOf "downloads") title --> doIgnore
More generally, to apply a comparison operation of some kind to a Query
string, use "fmap" to run it "inside" the Query. So you can read the first
version somewhat naturally as 'run ("downloads" `isInfixOf` x) with "x"
being the string inside of "title"'.
(You will probably need "import Data.List (isInfixOf)" at the top of your
brandon s. allbery [linux,solaris,freebsd,perl] allbery.b at gmail.com
system administrator [openafs,heimdal,too many hats] kf8nh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the xmonad