[xmonad] ManageHook question
Brandon S Allbery KF8NH
allbery.b at gmail.com
Sat Mar 5 08:45:30 CET 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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
or equivalently
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
xmonad.hs.)
- --
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/
iEYEARECAAYFAk1x6hoACgkQIn7hlCsL25VYYwCfbavF3cPlpTtcM8pq6K2gGsP+
Vr8An3O1VH7zrShw3s17E8TyBOZRK6He
=PJin
-----END PGP SIGNATURE-----
More information about the xmonad
mailing list