module/river: add support for the ‘mode’ event

Seat status v3 adds a new ‘mode’ event, that informs us of the current
mode (as set by e.g. ‘riverctl enter-mode passthrough’)

The mode is exposed as a tag (named “mode”) on river’s “title”
particle:

  - river:
      title:
        map:
          default: {empty: {}}
          conditions:
            mode == passthrough:
              string: {text: " {mode} ", deco: {background: {color: ff0000ff}}}
This commit is contained in:
Daniel Eklöf 2022-06-02 17:24:42 +02:00
parent a3a0334069
commit c738f1c63d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 60 additions and 7 deletions

View file

@ -16,7 +16,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</copyright>
<interface name="zriver_status_manager_v1" version="2">
<interface name="zriver_status_manager_v1" version="3">
<description summary="manage river status objects">
A global factory for objects that receive status information specific
to river. It could be used to implement, for example, a status bar.
@ -85,7 +85,7 @@
</event>
</interface>
<interface name="zriver_seat_status_v1" version="1">
<interface name="zriver_seat_status_v1" version="3">
<description summary="track seat focus">
This interface allows clients to receive information about the current
focus of a seat. Note that (un)focused_output events will only be sent
@ -121,5 +121,13 @@
</description>
<arg name="title" type="string" summary="title of the focused view"/>
</event>
<event name="mode" since="3">
<description summary="the active mode changed">
Sent once on binding the interface and again whenever a new mode
is entered (e.g. with riverctl enter-mode foobar).
</description>
<arg name="name" type="string" summary="name of the mode"/>
</event>
</interface>
</protocol>