Files
komorebi/docs/usage/floating-windows.md
T
LGUG2Z 5eaa613f50 feat(wm): configuration in komorebi.json
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.
2026-10-28 07:20:37 -07:00

4.3 KiB

Floating windows

A floating window is one of a workspace's windows that is not in its layout: komorebi gives it no tile and does not move it, and it stays where it is put by hand.

komorebic toggle-float takes the window that has the focus out of the layout, and the other windows of the workspace share the work area. The same command on a floating window puts it back in the layout, at the place of the focused window.

komorebic toggle-float

A floated window keeps its size and position by default. The floating windows of a workspace are in the daemon's state as floating_windows, next to its containers.

Windows that open floating

With the float override on, every window that opens floats instead of getting a tile. komorebic toggle-float-override turns it on and off for every workspace, and komorebic toggle-workspace-float-override for the focused workspace only: the first time it takes the opposite of what every workspace has, and from then on it follows its own setting.

komorebic toggle-float-override
komorebic toggle-workspace-float-override

The override is in the daemon's state, as float_override for every workspace and in each workspace that has one of its own.

In komorebi.json it is float_override, for every workspace and in the entry of a workspace. float_override_placement says what is done to the window the override floats: None leaves it where KWin put it, Center centers it in the work area and CenterAndResize also makes it half as tall as the work area, with the aspect ratio floating_window_aspect_ratio names. A window is centered only on a workspace that tiles.

The two layers

A workspace is on one of two layers: its tiles, or its floating windows. Which one decides what komorebic focus, cycle-focus, move and resize-edge act on. Floating a window puts the workspace on its floating layer, and giving the focus to a tiled window, with the pointer or a command, puts it back on its tiling layer. A window that opens and is tiled does the same, and so does putting a floating window back in the layout.

komorebic toggle-workspace-layer switches the layer by hand. The windows of the layer it goes to are raised in front of the others, and one of them is given the focus: the focused floating window, or the focused container's window. Going to the tiles hides the floating windows, and going back to the floating layer shows them.

komorebic toggle-workspace-layer

On the floating layer:

  • focus left, right, up and down give the focus to the nearest floating window on that side, by where KWin has them. When no floating window is on that side the focus goes to the monitor on that side, as it does for tiles, and the command fails where there is none: the daemon logs "there is no container or monitor in this direction".
  • cycle-focus next and previous go round the floating windows in the order they were floated, and wrap around.
  • move moves the focused floating window by the resize delta, 50 pixels unless it was set, and not out of the work area.
  • resize-edge and resize-axis change the frame of the focused floating window: increase on the left or the upper side moves it that way, and on the right or the lower side makes it wider or taller by twice the delta; decrease does the opposite.
  • preselect-direction does nothing.

komorebic toggle-maximize maximizes the focused floating window there, and when it is restored it is a tile, not a floating window.

The layer is layer in the state of each workspace, Tiling or Floating.

What a window that opens while a workspace is on its floating layer gets is floating_layer_behaviour in komorebi.json: Tile, the default, gives it a tile, and Float floats it, centered in the work area as floating_layer_placement says (Center by default; the values are those of float_override_placement). The entry of a monitor and the entry of a workspace can have a floating_layer_behaviour of their own: the workspace's comes before the monitor's, which comes before the one for every monitor.