protocols/
test/
.clang-format
571 B
.clangd
365 B
.gitignore
82 B
.gitsigners
91 B
LICENSE
32.3 KiB
LICENSE.dwl
34.9 KiB
LICENSE.dwm
2.0 KiB
LICENSE.spectrwm
1.3 KiB
LICENSE.sway
1.0 KiB
LICENSE.tinywl
7.0 KiB
Makefile
7.8 KiB
PKGBUILD
952 B
README
5.6 KiB
config.def.h
15.7 KiB
config.mk
269 B
swm.1.adoc
3.3 KiB
swm.c
246.5 KiB
swm.desktop
81 B
swm.h
3.5 KiB
swmctl.1.adoc
2.5 KiB
swmctl.c
19.6 KiB
util.c
2.2 KiB
util.h
399 B
swmctl.1.adoc
raw
| 1 | = swmctl(1) |
| 2 | :doctype: manpage |
| 3 | :manmanual: SWM Manual |
| 4 | :mansource: swm 1.0.0 |
| 5 | |
| 6 | == NAME |
| 7 | |
| 8 | swmctl - inspect and change swm workspace metadata |
| 9 | |
| 10 | == SYNOPSIS |
| 11 | |
| 12 | *swmctl workspace list* |
| 13 | |
| 14 | *swmctl workspace get* _N_ (*title*|*color*|*selected*) |
| 15 | |
| 16 | *swmctl workspace set* _N_ (*title* _TITLE_|*color* _#RRGGBB[AA]_) |
| 17 | |
| 18 | *swmctl workspace clear* _N_ (*title*|*color*) |
| 19 | |
| 20 | *swmctl workspace subscribe* [*--format=waybar*] |
| 21 | |
| 22 | == DESCRIPTION |
| 23 | |
| 24 | *swmctl* connects to the running *swm* Wayland compositor and reads or changes |
| 25 | the title and color associated with a workspace. This metadata is ephemeral: it |
| 26 | is stored only in compositor memory and is discarded when *swm* exits. |
| 27 | |
| 28 | An empty title clears the additional label. It does not change the numeric |
| 29 | workspace name. A cleared color tells consumers to use their default color. |
| 30 | Colors use six-digit RGB or eight-digit RGBA notation. RGB implies full |
| 31 | opacity. `#00000000` means unset, while `#000000` represents opaque black. |
| 32 | |
| 33 | *set* changes one named field. *clear* clears one named field. |
| 34 | |
| 35 | *get* prints one field value. An unset title or color produces an empty line; |
| 36 | *selected* produces `true` or `false`. |
| 37 | |
| 38 | *subscribe* writes a JSON array containing the current metadata, then writes a |
| 39 | new array after every change. Each array occupies one line, making the command |
| 40 | suitable for custom bars and other long-running consumers. |
| 41 | |
| 42 | With *--format=waybar*, *subscribe* instead writes Waybar custom-module JSON |
| 43 | for the workspace on swm's selected output. Its additional title becomes the |
| 44 | module text and its color becomes the text foreground. An unset title produces |
| 45 | empty text. Configure the module with `return-type` set to `json` and `escape` |
| 46 | set to `false`. |
| 47 | |
| 48 | == WAYBAR |
| 49 | |
| 50 | The `ext/workspaces` module continues to display the numeric workspace names |
| 51 | `1` through `10`. A custom module can display the additional title and color |
| 52 | independently: |
| 53 | |
| 54 | "modules-center": ["custom/workspace-title"], |
| 55 | "custom/workspace-title": { |
| 56 | "exec": "swmctl workspace subscribe --format=waybar", |
| 57 | "return-type": "json", |
| 58 | "escape": false, |
| 59 | "hide-empty-text": true |
| 60 | } |
| 61 | |
| 62 | The custom module follows the workspace on swm's selected output and uses its |
| 63 | color for the title text. |
| 64 | |
| 65 | == EXAMPLES |
| 66 | |
| 67 | Set both fields for workspace 3: |
| 68 | |
| 69 | swmctl workspace set 3 title "Prototyping new window manager" |
| 70 | swmctl workspace set 3 color "#81a1c1" |
| 71 | |
| 72 | Print its title: |
| 73 | |
| 74 | swmctl workspace get 3 title |
| 75 | |
| 76 | Clear only its color: |
| 77 | |
| 78 | swmctl workspace clear 3 color |
| 79 | |
| 80 | List every workspace number: |
| 81 | |
| 82 | swmctl workspace list |
| 83 | |
| 84 | == SEE ALSO |
| 85 | |
| 86 | *swm*(1), *waybar*(5) |