feat(wm): more than one monitor

Every monitor has workspaces of its own, which KWin's per-output desktops show
independently, so a second monitor is mostly the window manager's business:
which monitor has the focus, and how a window gets from one to the other.

At the edge of a monitor, focus and move now cross to the monitor on that side,
where they used to fail with "there is no container in this direction": the
focus lands on the container nearest the monitor it came from, and a move swaps
with the container at that edge (cross-monitor-move-behaviour insert puts it in
among the containers there, no-op keeps it). A window that opens or gets the
focus on a monitor that is not the focused one focuses that monitor, which also
makes the scrolling test of a strip next to another monitor guard real code.

The monitor commands come with it: focusing a monitor by index, in order or
under the pointer, a workspace of another monitor, moving and sending the
focused window to another monitor, to a workspace of it or to a named workspace
(in the window manager these are moves between monitors, so they were left out
of the workspace commands), moving and swapping workspaces between monitors, and
a display index preference that keeps a monitor at the index the user gives it.
eager-focus focuses the first window of an executable on any workspace of any
monitor; its window is found in a container or among the floating windows, the
two places a window can be until stacks, monocle and maximize exist.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:37 -07:00
1 parent 8467b03ac2
commit 189aeb1005
41 files changed
+3172 -28

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
```text
Set the behaviour when moving windows across monitor boundaries
Usage: cross-monitor-move-behaviour <MOVE_BEHAVIOUR>
Arguments:
<MOVE_BEHAVIOUR>
Possible values:
- swap: Swap the window container with the window container at the edge of the adjacent
monitor
- insert: Insert the window container into the focused workspace on the adjacent monitor
- no-op: Do nothing if trying to move a window container in the direction of an adjacent
monitor
Options:
-h, --help
Print help (see a summary with '-h')
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the monitor in the given cycle direction
Usage: cycle-monitor <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 monitor in the given cycle direction
Usage: cycle-move-to-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
@@ -0,0 +1,14 @@
```text
Move the focused workspace monitor in the given cycle direction
Usage: cycle-move-workspace-to-monitor <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 monitor in the given cycle direction
Usage: cycle-send-to-monitor <CYCLE_DIRECTION>
Arguments:
<CYCLE_DIRECTION>
[possible values: previous, next]
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Set the display index preference for a monitor identified using its display name
Usage: display-index-preference <INDEX_PREFERENCE> <DISPLAY>
Arguments:
<INDEX_PREFERENCE>
Preferred monitor index (zero-indexed)
<DISPLAY>
Display name as identified in komorebic state
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the first managed window matching the given executable
Usage: eager-focus <EXE>
Arguments:
<EXE>
Case-sensitive exe identifier
Options:
-h, --help
Print help
```
+10
View File
@@ -0,0 +1,10 @@
```text
Focus the monitor at the current cursor location
Usage: focus-monitor-at-cursor
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Focus the specified workspace on the target monitor
Usage: focus-monitor-workspace <TARGET_MONITOR> <TARGET_WORKSPACE>
Arguments:
<TARGET_MONITOR>
Target monitor index (zero-indexed)
<TARGET_WORKSPACE>
Workspace index on the target monitor (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Focus the specified monitor
Usage: focus-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Move the focused window to the specified monitor workspace
Usage: move-to-monitor-workspace <TARGET_MONITOR> <TARGET_WORKSPACE>
Arguments:
<TARGET_MONITOR>
Target monitor index (zero-indexed)
<TARGET_WORKSPACE>
Workspace index on the target monitor (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Move the focused window to the specified monitor
Usage: move-to-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Move the focused window to the specified workspace
Usage: move-to-named-workspace <WORKSPACE>
Arguments:
<WORKSPACE>
Target workspace name
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Move the focused workspace to the specified monitor
Usage: move-workspace-to-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+17
View File
@@ -0,0 +1,17 @@
```text
Send the focused window to the specified monitor workspace
Usage: send-to-monitor-workspace <TARGET_MONITOR> <TARGET_WORKSPACE>
Arguments:
<TARGET_MONITOR>
Target monitor index (zero-indexed)
<TARGET_WORKSPACE>
Workspace index on the target monitor (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Send the focused window to the specified monitor
Usage: send-to-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Send the focused window to the specified workspace
Usage: send-to-named-workspace <WORKSPACE>
Arguments:
<WORKSPACE>
Target workspace name
Options:
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Swap focused monitor workspaces with specified monitor
Usage: swap-workspaces-with-monitor <TARGET>
Arguments:
<TARGET>
Target index (zero-indexed)
Options:
-h, --help
Print help
```
@@ -0,0 +1,10 @@
```text
Toggle the behaviour when moving windows across monitor boundaries
Usage: toggle-cross-monitor-move-behaviour
Options:
-h, --help
Print help
```