composeAll
[ className =? "Xfce4-panel" <&&> title =? "Panel" --> doFloat
, className =? "Xfce4-panel" <&&> title =? "Add New Items" --> doFloat
......
] <+>
Which strategy should I use to make the same className applies to
different titles?
One possibility is
className =? "Xfce4-panel" <&&> fmap (\t -> any (== t) ["Panel", "Add New Items", ...]) title
This can probably be made prettier.
matchAny :: Eq a => Query a -> [a] -> Query Bool
matchAny t ts = fmap (\s -> any (== s) ts) t
className =? "Xfce4-panel" <&&> matchAny title ["Panel", "Add New Items", ...] --> doFloat
Another possibility, depending on exactly what you're trying to do, is
className =? "Xfce4-panel" -->
composeAll [title =? "Panel" --> doFloat
,title =? "Add New Items" --> doFloat
]
and then rearrange the inner composeAll in various ways.
--