komorebi managed every normal window that is alive, and there was no way to keep an application out of the layout. The rule engine decides whether a window is managed: an ignore rule keeps the windows it matches out, unless a manage rule matches them too, and a float rule puts a window in the floating windows of its workspace when it opens. A rule matches a window by its title, its executable, its class or the path of its executable. Plasma's shell and KRunner are ignored from the start. `komorebic ignore-rule` and `manage-rule` add a rule, `session-float-rule` floats the focused window and the windows like it until the daemon stops, `clear-session-float-rules` removes those rules, and `global-state` shows the rules. The `DebugWindow` message says why a window is managed or not. Applications often open a window before they give it its title, so the bridge now reports a title change, and a window komorebi does not have is asked about again when its title changes, for a rule on the title to decide. The vm-commands sweep adds and shows rules, and a section of its own checks that a window an ignore rule matches by its first title is tiled once it has another. vm-kwin-events checks that a window giving itself another title reaches the daemon as a title update.
2.9 KiB
Managing windows
komorebi tiles every normal application window that KWin reports, and leaves dialogs, splash screens and other windows that are not for tiling alone, and the windows that rules say to ignore. The commands here act on the window that has the focus in KWin, take a window out of the layout or back into it, and pause the daemon.
Minimizing and closing
komorebic minimize asks KWin to minimize the window that has the focus,
and komorebic close asks it to close the window, as the buttons of its title
bar do.
komorebic minimize
komorebic close
The window leaves the layout when KWin reports that it was minimized or closed, and the other windows of the workspace share the work area. A minimized window comes back into the layout, in a container of its own, when it is restored.
Taking a window out of the layout
komorebic unmanage takes the window that has the focus out of the layout.
It stays open, in the middle of the work area with the size it had, and komorebi leaves it alone
from then on: it does not tile it again, and it does not move it.
komorebic manage, with that window focused, puts it back in the layout,
after the focused window.
komorebic unmanage
komorebic manage
komorebic manage also takes in a window komorebi missed, such as one that opened while the
daemon was paused, but not a window an ignore rule covers. The daemon forgets an unmanaged window when it closes, and when the daemon
stops.
Commands while the focused window is not tiled
By default, a command acts on the workspace whatever window has the focus. With
komorebic unmanaged-window-operation-behaviour no-op,
the daemon ignores every command while the window that has the focus is not one of the windows it
tiles: a floating window, a window it does not manage, or one taken out with
komorebic unmanage. The daemon logs "ignoring commands while active window is not managed by
komorebi" for each.
komorebic unmanaged-window-operation-behaviour no-op
komorebic unmanaged-window-operation-behaviour op
The commands that are ignored include komorebic state, komorebic stop and the command that
sets the behavior back to op: give the focus to a tiled window first.
Pausing
komorebic toggle-pause pauses the daemon, and the same command
resumes it. While it is paused, komorebi does not act on what KWin reports, so it moves no
window, and of its commands it carries out only toggle-pause, state, global-state and
stop. The daemon's state says whether it is paused, as is_paused.
komorebic toggle-pause
What KWin reported while the daemon was paused is not acted on afterwards: a window that opened
in the meantime is not tiled until it is managed with komorebic manage.