feat(wm): named workspaces and the other workspace commands

Workspace i is KWin's desktop i, and switching and moving by index came with the
workspaces. What a user binds keys to besides is the rest of komorebi's
workspace commands: going to the next or the previous workspace (or the next
empty one), back to the last one, adding and closing workspaces, showing one
index on every monitor, and setting the layout or the tiling of a workspace that
need not be in front. They are made of the same two operations, showing a
workspace and moving a container to one, so KWin keeps doing the showing and the
hiding.

A workspace gets a name, which focus-named-workspace, named-workspace-layout and
named-workspace-tiling find it by on any monitor; focusing a named workspace
focuses its monitor too, so focus_monitor comes with it. The name is komorebi's:
naming a workspace does not rename KWin's desktop. The query
focused-workspace-name answers with the name, or the index of a workspace that
has none.

The moves to a named workspace, and everything that addresses a monitor, are
moves between monitors in the window manager and come with more than one
monitor.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:37 -07:00
1 parent 62e37e44cf
commit 8467b03ac2
33 files changed
+1782 -9

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
```text
Close the focused workspace (must be empty and unnamed)
Usage: close-workspace
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the next empty workspace in the given cycle direction (if one exists)
Usage: cycle-empty-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Move the focused window to the workspace in the given cycle direction
Usage: cycle-move-to-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Send the focused window to the workspace in the given cycle direction
Usage: cycle-send-to-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the workspace in the given cycle direction
Usage: cycle-workspace <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Create these many named workspaces for the specified monitor
Usage: ensure-named-workspaces <MONITOR> [NAMES]...
Arguments:
<MONITOR>
Monitor index (zero-indexed)
[NAMES]...
Names of desired workspaces
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Create at least this many workspaces for the specified monitor
Usage: ensure-workspaces <MONITOR> <WORKSPACE_COUNT>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE_COUNT>
Number of desired workspaces
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Focus the last focused workspace on the focused monitor
Usage: focus-last-workspace
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the specified workspace
Usage: focus-named-workspace <WORKSPACE>
Arguments:
<WORKSPACE>
Target workspace name
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the specified workspace on all monitors
Usage: focus-workspaces <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Move the focused window to the last focused monitor workspace
Usage: move-to-last-workspace
Options:
-h, --help
Print help
```
+26
View File
@@ -0,0 +1,26 @@
```text
Set the layout for the specified workspace
Usage: named-workspace-layout <WORKSPACE> <VALUE>
Arguments:
<WORKSPACE>
Target workspace name
<VALUE>
Possible values:
- bsp: BSP Layout
- columns: Columns Layout
- rows: Rows Layout
- vertical-stack: Vertical Stack Layout
- horizontal-stack: Horizontal Stack Layout
- ultrawide-vertical-stack: Ultrawide Vertical Stack Layout
- grid: Grid Layout
- right-main-vertical-stack: Right Main Vertical Stack Layout
- scrolling: Scrolling Layout
Options:
-h, --help
Print help (see a summary with '-h')
```
+17
View File
@@ -0,0 +1,17 @@
```text
Enable or disable window tiling for the specified workspace
Usage: named-workspace-tiling <WORKSPACE> <VALUE>
Arguments:
<WORKSPACE>
Target workspace name
<VALUE>
[possible values: enable, disable]
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Create and append a new workspace on the focused monitor
Usage: new-workspace
Options:
-h, --help
Print help
```
+2 -1
View File
@@ -6,7 +6,8 @@ Usage: query <STATE_QUERY>
Arguments:
<STATE_QUERY>
[possible values: focused-monitor-index, focused-workspace-index, focused-container-index,
focused-window-index, focused-workspace-layout, focused-container-kind, version]
focused-window-index, focused-workspace-name, focused-workspace-layout,
focused-container-kind, version]
Options:
-h, --help
+10
View File
@@ -0,0 +1,10 @@
```text
Send the focused window to the last focused monitor workspace
Usage: send-to-last-workspace
Options:
-h, --help
Print help
```
+29
View File
@@ -0,0 +1,29 @@
```text
Set the layout for the specified workspace
Usage: workspace-layout <MONITOR> <WORKSPACE> <VALUE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
<VALUE>
Possible values:
- bsp: BSP Layout
- columns: Columns Layout
- rows: Rows Layout
- vertical-stack: Vertical Stack Layout
- horizontal-stack: Horizontal Stack Layout
- ultrawide-vertical-stack: Ultrawide Vertical Stack Layout
- grid: Grid Layout
- right-main-vertical-stack: Right Main Vertical Stack Layout
- scrolling: Scrolling Layout
Options:
-h, --help
Print help (see a summary with '-h')
```
+20
View File
@@ -0,0 +1,20 @@
```text
Set the workspace name for the specified workspace
Usage: workspace-name <MONITOR> <WORKSPACE> <VALUE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
<VALUE>
Name of the workspace as a String
Options:
-h, --help
Print help
```
+20
View File
@@ -0,0 +1,20 @@
```text
Enable or disable window tiling for the specified workspace
Usage: workspace-tiling <MONITOR> <WORKSPACE> <VALUE>
Arguments:
<MONITOR>
Monitor index (zero-indexed)
<WORKSPACE>
Workspace index on the specified monitor (zero-indexed)
<VALUE>
[possible values: enable, disable]
Options:
-h, --help
Print help
```