protocols/swm-workspace-v1.xml 2.8 KiB raw
1
<?xml version="1.0" encoding="UTF-8"?>
2
<protocol name="swm_workspace_v1">
3
  <copyright>
4
    Copyright (C) 2026 swm contributors
5
6
    This program is free software: you can redistribute it and/or modify
7
    it under the terms of the GNU General Public License as published by
8
    the Free Software Foundation, either version 3 of the License, or
9
    (at your option) any later version.
10
  </copyright>
11
12
  <interface name="swm_workspace_manager_v1" version="1">
13
    <description summary="inspect and change swm workspace metadata">
14
      This interface exposes ephemeral titles and colors associated with
15
      swm's fixed workspaces. Metadata exists only for the lifetime of the
16
      compositor process.
17
18
      When a client binds, the compositor sends one metadata event for every
19
      workspace followed by done. Later changes are sent in the same way.
20
    </description>
21
22
    <enum name="error">
23
      <entry name="invalid_workspace" value="1" summary="workspace number is out of range"/>
24
      <entry name="title_too_long" value="2" summary="workspace title is too long"/>
25
    </enum>
26
27
    <enum name="metadata">
28
      <entry name="title" value="1" summary="the title is non-empty"/>
29
      <entry name="color" value="2" summary="the color is set"/>
30
      <entry name="selected" value="4" summary="the workspace is selected by swm"/>
31
    </enum>
32
33
    <event name="metadata">
34
      <description summary="workspace metadata">
35
        The workspace number starts at one. Color is encoded as 0xRRGGBBAA;
36
        zero means unset and omits the color bit from flags. An empty
37
        title means the additional label is unset. Selected identifies the
38
        workspace on swm's currently selected output.
39
      </description>
40
      <arg name="workspace" type="uint" summary="one-based workspace number"/>
41
      <arg name="flags" type="uint" enum="metadata"/>
42
      <arg name="title" type="string"/>
43
      <arg name="color" type="uint" summary="color encoded as 0xRRGGBBAA"/>
44
    </event>
45
46
    <event name="done">
47
      <description summary="metadata update is complete"/>
48
    </event>
49
50
    <request name="set_title">
51
      <description summary="set a workspace title">
52
        Set the title of a workspace. An empty title clears it.
53
      </description>
54
      <arg name="workspace" type="uint" summary="one-based workspace number"/>
55
      <arg name="title" type="string"/>
56
    </request>
57
58
    <request name="set_color">
59
      <description summary="set a workspace color">
60
        Set the color of a workspace. Zero clears it.
61
      </description>
62
      <arg name="workspace" type="uint" summary="one-based workspace number"/>
63
      <arg name="color" type="uint" summary="color encoded as 0xRRGGBBAA"/>
64
    </request>
65
66
    <request name="destroy" type="destructor">
67
      <description summary="release the manager object"/>
68
    </request>
69
  </interface>
70
</protocol>