]> icculus.org git repositories - mikachu/openbox.git/commit
Add queries to If actions
authorDana Jansens <danakj@orodu.net>
Sun, 18 Aug 2013 23:29:05 +0000 (19:29 -0400)
committerMikael Magnusson <mikachu@gmail.com>
Mon, 19 Aug 2013 00:55:49 +0000 (02:55 +0200)
commit9fae441e2048c3c575443df7f148c908c196970c
tree656a91a567a17235d27776af4e0a11f5822962b1
parent3e5f00cab5ceac9f8d03065b43b296ee16de5326
Add queries to If actions

This allows the If action to run queries against a client other than
the target of the actions being run, for example to check state on
the focused window while performing actions on another window during
focus cycling.

The syntax looks like

<action name="If">
  <query target="default">
    <title>FooBar</title>
    <maximized>yes</maximized>
  </query>
  <query target="focus">
    <desktop>3</desktop>
  </query>
  <then>
   <action name="NextDesktop"/>
  </then>
</action>

The above checks the client window that the actions will run on to
verify that its title is "FooBar" and that it is maximized. If that
is true, it also checks that the currently focused client window is
on desktop 3. If that is true also, then it runs the NextDesktop
action.

The target="" option can be set to "default" which uses the client
window that the actions will run on, or it can be "focus" which uses
the client window that is currently focused.

The <query> tag is optional, and the conditions inside the query can
be placed directly inside the If <action> tag, as they were before
this change. In that case, a default <query> tag is assumed with
target="default" which matches the previous behaviour.

Multiple <query> tags can be present, and they must all be true in
order to run the actions in <then>. If any one is false, the actions
in <else> will be run instead.

Conflicts:
openbox/actions/if.c
openbox/actions/if.c