[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Super flexible rules



Hi all,

what follows is a very simple suggestion for a powerful rule mechanism
that naturally extends the existing one. The idea is to add a flag
that is neither exactly a condition nor a consequence but a script
that generates further conditions and/or consequences. For example:

rule class=Netscape windowtype=_NET_WM_WINDOW_TYPE_DIALOG
rest=netrule.sh tag=6 focus=off

would mean: check that the window class is Netscape and window type is
dialog; if false just abort, otherwise call netrule.sh with instance,
class, title, pid, maxage, windowtype and windowrole as parameters
(alternatively as its environment); if netrule.sh outputs the string
"0" or "false" (alternatively returns a code != 0) abort, otherwise
netrule.sh should output something like, say, "title~.*mail index=/0";
combine this output with the rest of the parameters to get
"title~.*mail index=/0 tag=6 focus=off"; then apply this rule as
usual.

This mechanism would allow to implement things like:

- Rules that are contextual to specific workspaces

- catch-all and dedicated frames

- In general, more complex logical expressions, not just because of
the extended logical form but because of the ability to further
inspect hswm state.

- And also, more complex consequences because of the ability to
(carefully!) manipulate hswm state (for example, to change the current
workspace).

What do you think?

Best regards
--
Carlos