The daemon takes its settings from a komorebi.json: the file --config names, or the one in the config home ($KOMOREBI_CONFIG_HOME, else ~/.config/komorebi). Without a file it runs on its defaults, as before. StaticConfig reads the file in three steps, because the monitors are known only after the backend has been asked. preload makes the window manager and applies the settings that are process-wide, postload gives each monitor and workspace the entry of its place (by the index display_index_preferences gives a monitor's serial number id, else in order), and main asks KWin for a desktop for each workspace the file lists. A watcher on the file sends the daemon a ReloadStaticConfiguration about two seconds after it changes, whether an editor wrote the file in place or renamed a new one over it, and a file that does not parse changes nothing. A workspace can change its layout, its work area offset and its layout options with the number of its containers, from the file or with komorebic (workspace-layout-rule, its named form and the two that clear), and layout_defaults gives every workspace of a layout the options it sets none of. One file is meant to serve every platform, so a key that does nothing on Plasma is accepted and ignored. config_parity checks the example and the files of other platforms; the keys of features that are not in yet are listed there, and the test fails when a list names a key that is read. The file also sets what the stacks, the float override, the floating layer and monocle set while the daemon runs: window_container_behaviour, with its rules by container count in a workspace, float_override, float_override_placement, floating_layer_behaviour (for a monitor and a workspace too), floating_layer_placement and monocle_focus_behaviour. Their features come before this commit, but a file to put the keys in does not, so they are part of this one. komorebic gains configuration, generate-static-config and start --config. The NixOS module gets configFile, which the unit gives the daemon as --config.
2.8 KiB
Monocle
A workspace in monocle shows one window: the container that has the focus takes the whole work area, and the layout gives the other containers no tile, and their windows are out of sight, until the monocle is turned off.
komorebic toggle-monocle turns the monocle of the focused workspace
on, for the container that has the focus, and off. The window is put where a window alone in the
workspace would be: the work area less the panels, the workspace padding and the container
padding. Turned off, the container goes back to the place in the order of the workspace it was
taken from, and the layout tiles every container again.
komorebic toggle-monocle
The windows of the other containers are hidden while the monocle is on, the way the windows behind the front one of a stack are, and the front window of each is shown again when the monocle is turned off. A window that opens meanwhile is added to the layout after the focused container, and has its tile when the monocle is turned off. When the window in monocle closes, the monocle is gone and the other windows are shown and tiled again.
Focusing
Giving the focus to another window does not take the monocle with it: komorebi gives the focus
back to the window in monocle, so that it is the one in front. What focusing in a direction
does meanwhile is set with
komorebic monocle-focus-behaviour:
no-op, the default: no container is on any side of the window in monocle, sokomorebic focusgoes to the monitor on that side, as it does at the edge of a layout, and gives the focus to the window in monocle there if its workspace has one. Where there is no monitor on that side it fails, and the daemon logs "there is no container or monitor in this direction".cycle:komorebic focus leftordownmakes the previous container the monocle, andrightorupthe next one.
komorebic toggle-monocle-focus-behaviour switches
between the two, and monocle_focus_behaviour in komorebi.json (NoOp or Cycle) sets it from
the file. komorebic cycle-focus always carries the monocle to the next or
the previous container, whatever the behavior is.
komorebic monocle-focus-behaviour cycle
komorebic toggle-monocle-focus-behaviour
What is left alone
While a window is in monocle, komorebic move and
komorebic cycle-move are refused, and
komorebic toggle-float does nothing: the daemon logs that it ignores
them. Turn the monocle off first.
In the daemon's state, a workspace in monocle has the container as monocle_container, which
is not one of its containers, and the index it goes back to as monocle_container_restore_idx.