[xmonad] ManageHook question
Sean Allen
sean at monkeysnatchbanana.com
Sat Mar 5 16:22:01 CET 2011
Thanks Brandon.
I'm constantly amused by what haskell I can figure out to get stuff
working in and what I can't.
I'm going to dig deeper into your explanation and hopefully really
learn something.
On Sat, Mar 5, 2011 at 2:45 AM, Brandon S Allbery KF8NH
<allbery.b at gmail.com> wrote:
> -----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-----
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
>
More information about the xmonad
mailing list