[xmonad] Same className, different titles --> same managehook

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Sat Oct 27 21:59:29 CEST 2012


Quoting "Pablo Olmos de Aguilera C." <pablo at glatelier.org>:

> I want to apply a similar configuration to some specific "children"
> from a window. I've been mixing managehooks, but looks very repetitive.
>
>     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?

How about this?

floatPanel t = className =? "Xfce4-panel" <&&> title =? t --> doFloat

and then, in your manage hook,

composeAll [ floatPanel "Panel", floatPanel "Add New Items", .... ]

Of course floatPanel can be generalized or specialized in a couple  
million different ways, depending on exactly what you want to do.
~d



More information about the xmonad mailing list