[xmonad] Re: Use regexps for className matching?

mail at justinbogner.com mail at justinbogner.com
Mon Feb 9 12:06:13 EST 2009


Don Stewart <dons at galois.com> writes:
>> You can use one of the haskell regex libraries and define an operator
>> for the managehook like so:
>> 
>> > import Text.Regex.Posix ((=~))
>> >
>> > q ~? x = fmap (=~ x) q
>> 
>> and then your example is simply
>> 
>> > className ~? "Google .*" --> doShift "1"
>
> Having someone interested write an extension module of regex combinators
> for this kind of thing would be useful.
>
> -- Don

Other than lifting (=~) and possibly another function or two, what would
this do? I'd be happy to put the two lines it takes to define (~?) into
a module, but that seems a bit slim (I guess it couldn't hurt though).

-- 
Gravity brings me down.



More information about the xmonad mailing list