Files
komorebi/docs/usage/workspaces.md
T
LGUG2Z 70c2affa9d docs(repo): compare the three komorebi programs and fix what the docs got wrong
docs/dev/COMPARE.md says what komorebi for KDE shares with komorebi for Windows
and komorebi for Mac, what differs, what KDE does by itself and what is not
supported, for a reader who knows komorebi on one of them. Its tables are
generated by scripts/compare-gen.py from this checkout and from checkouts of the
other two, because a count or a name typed by hand is wrong after the next
change to a command, a key or an event. The script also checks the notes that
say why a command has no counterpart, and the sentences of the document that
depend on a table, and stops when one of them is no longer true. CI has neither
checkout and cannot run it; CONTRIBUTING says when to run it. The tables have no
column for the commit that added a row: the plan that numbered the commits is
not in the repository, and a number the script cannot derive for the next commit
would stop it.

The other documents had places that said something the repository does not carry
or does not do:

- DESIGN cited docs/kde.md, which no commit carries, said spike 8 "asked
  whether" one komorebi.json could be shared, and described the default of the
  key binding mode as a plan. Each entry now states the rule and the evidence.
  The first entry no longer says that the Windows implementation is the
  reference: both it and the macOS one were read, and the native thing is
  preferred where the other two need a workaround.
- "The spikes" was used in PLATFORM, DESIGN and COMPARE and defined nowhere.
  PLATFORM's vocabulary defines it, and PLATFORM has a list of what was not
  measured, which COMPARE links to.
- ARCHITECTURE said a maximized window is hidden with its workspace and shown
  with it, and that the code has a TODO for cycling the focus. A workspace
  switch hides nothing, since KWin shows and hides the desktop's windows, and
  the cycle leaves a maximized window as it is; the TODO and the commented-out
  code under it in window_manager.rs are replaced by a comment that says so. The
  Key bindings section no longer repeats the headings of the sections before it.
- README listed the subcommands that work without the daemon, and the list was
  short. It gives the rule and one example of each kind.
- The page on changing monitors opened with "nothing to configure" and then
  named display_index_preferences.
- COMPARE said KWin waits 300 ms for the pointer to settle before it moves the
  focus. That is KWin's default (DelayFocusInterval, in KWin 6.8.1), and
  komorebi sets it to 0 while focus follows mouse is on; the page now says so.
- ARCHITECTURE's opening list of what the page describes stopped at the borders
  and had no word of animation, themes, wallpapers, transparency, focus follows
  mouse or key bindings. Two link definitions that it had twice are there once.
- PLATFORM's list of what was not measured has the progress of the stock
  animation effect against the clock: one capture showed none four seconds into
  a 30 s animation, where the curve gives about 60 %.
- README, docs/index.md and ARCHITECTURE link COMPARE.md.
- COMPARE's list of the methods of Backend has drag_end, which the end of a
  resize is read through, and compare-gen.py has the row and the counts.
2026-10-28 07:39:49 -07:00

120 lines
5.4 KiB
Markdown

# Workspaces
Each monitor has workspaces, and shows one of them at a time. A workspace has its own windows
and its own layout. komorebi's workspaces are KWin's virtual desktops: workspace 0 is the first
desktop, workspace 1 the second, and so on, which is why the pager, the overview and KWin's
shortcuts show and switch them too.
komorebi turns on KWin's per-output virtual desktops when it starts, so that each monitor shows
a desktop of its own: switching the workspace of one monitor leaves the others as they are. It
puts the setting back as it was when it stops.
## Showing another workspace
[`komorebic focus-workspace`](../cli/focus-workspace.md) shows a workspace of the focused
monitor, by its number, counted from 0. KWin shows the windows of that workspace and hides the
others, and the window of that workspace that had the focus has it again.
```sh
komorebic focus-workspace 1
komorebic focus-workspace 0
```
A workspace that does not exist yet is created, with the ones before it, and KWin gets a
desktop for each, named "Workspace 2" and so on. A desktop that is there already keeps its
name. The desktops komorebi creates stay when it stops.
## Moving a window to another workspace
[`komorebic move-to-workspace`](../cli/move-to-workspace.md) takes the focused window to another
workspace, puts it after the windows there, and shows that workspace.
[`komorebic send-to-workspace`](../cli/send-to-workspace.md) does the same and stays on the
workspace in front, which is tiled again without the window.
```sh
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 the monitor that 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
shortcuts, the overview, or an application that raises a window of another desktop (KWin then
shows that desktop and focuses the window). komorebi follows, tiles the workspace that came
into view, and asks KWin for nothing in reply. A window moved to another desktop with the
window menu's "Move to Desktop" moves to that workspace.
## The windows that were open before
When komorebi starts, each window that is open goes to the workspace whose desktop it is on,
and each monitor starts on the workspace KWin shows there. A window that is on every desktop
goes to the workspace in front.