10 Feb
2009
10 Feb
'09
12:20 a.m.
Henri Ducrocq <henri.ducrocq@gmail.com> writes: | For example | className =? "Google Mail" --> doShift "1" | className =? "Google Calendar" --> doShift "1" | would become | className <some regexp matching operator> "Google .*" doShift "1" | | How to do this in Haskell? I couldn't find any examples of this in the config | archive.. 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"