action: add If and ForEach actions

Add If and ForEach actions as described in OpenBox specification.

Limitations:

- If and ForEach cannot contain nested If and ForEach.
This commit is contained in:
Consus 2023-08-28 19:14:04 +03:00 committed by Johan Malm
parent 12f6a8975a
commit 22e3be40e5
4 changed files with 307 additions and 3 deletions

View file

@ -148,6 +148,56 @@ Actions are used in menus and keyboard/mouse bindings.
*<action name="None" />*
If used as the only action for a binding: clear an earlier defined binding.
# CONDITIONAL ACTIONS
Actions that execute other actions. Used in keyboard/mouse bindings.
*<action name="If">*
This action will execute one set of actions if the focused window
matches the criteria, or another if it does not.
The arguments are as follows:
```
<action name="If">
<query/>
<then><action/></then>
<else><action/></else>
</action>
```
*query*
Define a query with zero or more conditions. All conditions must
be evaluated as true in order for the window to match this
query. Multiple queries can be defined.
Pattern matching is done according to glob(7) and is
case-insensitive.
Conditions are as follows:
*identifier*
XDG shell app_id for Wayland clients, WM_CLASS for
XWayland clients.
*title*
XDG shell title for Wayland clients, WM_NAME for
XWayland clients.
This argument is optional.
*then*
A list of actions to be executed if the window matches any
query. This argument is optional.
*else*
A list of actions to be executed if the window does not match
any query. This argument is optional.
*<action name="ForEach">*
Identical to "If" action, but applies to all windows, not just the
focused one.
# SEE ALSO
labwc(1), labwc-config(5), labwc-theme(5)
labwc(1), labwc-config(5), labwc-theme(5), glob(7)