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

+68
View File
@@ -36,6 +36,74 @@ komorebic move-to-workspace 1
komorebic send-to-workspace 2
```
## Going round the workspaces
[`komorebic cycle-workspace`](../cli/cycle-workspace.md) shows the next or the previous workspace
of the focused monitor, and wraps around at both ends;
[`komorebic cycle-empty-workspace`](../cli/cycle-empty-workspace.md) shows the next or the previous
one that has no window, if there is one.
[`komorebic cycle-move-to-workspace`](../cli/cycle-move-to-workspace.md) and
[`komorebic cycle-send-to-workspace`](../cli/cycle-send-to-workspace.md) take the focused window to
the next or the previous workspace, with and without showing it.
```sh
komorebic cycle-workspace next
komorebic cycle-empty-workspace previous
komorebic cycle-move-to-workspace next
```
## The last workspace
Each monitor remembers which workspace was in front before the one in front now.
[`komorebic focus-last-workspace`](../cli/focus-last-workspace.md) shows it again, so two in a row
go back and forth between the two.
[`komorebic move-to-last-workspace`](../cli/move-to-last-workspace.md) and
[`komorebic send-to-last-workspace`](../cli/send-to-last-workspace.md) take the focused window
there, with and without showing it.
## Names
[`komorebic workspace-name`](../cli/workspace-name.md) names a workspace, given by the index of its
monitor and its own index, and
[`komorebic ensure-named-workspaces`](../cli/ensure-named-workspaces.md) gives a monitor a workspace
for each name it is given, in order. The name is komorebi's, for the commands that find a
workspace by its name: KWin's desktop keeps the name it has.
[`komorebic focus-named-workspace`](../cli/focus-named-workspace.md) shows the workspace with that
name, on whichever monitor has it, and focuses that monitor. A name no workspace has changes
nothing. `komorebic query focused-workspace-name` prints the name of the workspace in front, or its
index when it has none.
```sh
komorebic ensure-named-workspaces 0 web code mail
komorebic focus-named-workspace mail
```
## Adding and removing workspaces
[`komorebic new-workspace`](../cli/new-workspace.md) adds a workspace after the last one of the
focused monitor and shows it, and [`komorebic ensure-workspaces`](../cli/ensure-workspaces.md)
gives a monitor at least as many workspaces as it is told.
[`komorebic close-workspace`](../cli/close-workspace.md) removes the workspace in front and shows
the one before it, when the workspace has no window and no name and is not the monitor's last.
[`komorebic focus-workspaces`](../cli/focus-workspaces.md) shows the workspace with the same index
on every monitor.
## The layout of another workspace
[`komorebic workspace-layout`](../cli/workspace-layout.md) and
[`komorebic workspace-tiling`](../cli/workspace-tiling.md) set the layout of a workspace, and turn
its tiling off or on, by the index of its monitor and its own index;
[`komorebic named-workspace-layout`](../cli/named-workspace-layout.md) and
[`komorebic named-workspace-tiling`](../cli/named-workspace-tiling.md) find it by its name. The
focused workspace is tiled again at once, and another workspace the next time it is tiled, when it
is shown at the latest.
```sh
komorebic workspace-layout 0 1 columns
komorebic named-workspace-tiling mail disable
```
## Switching with KWin
Anything that switches KWin's desktop switches komorebi's workspace: the pager, KWin's own