Files
komorebi/docs/example-configurations.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.1 KiB

Example configurations

komorebi, and tiling window managers in general, are very complex pieces of software. To make starting out easier, the repository has an example configuration, docs/komorebi.example.json, which is kept working: a test loads it with every change.

komorebi.json

The example sets some defaults and gives the first monitor eight workspaces, each with a different layout. This page has the file as it is:

{
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 15,
  "default_container_padding": 15,
  "floating_window_aspect_ratio": "Widescreen",
  "floating_layer_behaviour": "Float",
  "resize_delta": 100,
  "ignore_rules": [],
  "floating_applications": [],
  "manage_rules": [],
  "monitors": [
    {
      "workspaces": [
        {
          "name": "I",
          "layout": "BSP"
        },
        {
          "name": "II",
          "layout": "VerticalStack"
        },
        {
          "name": "III",
          "layout": "HorizontalStack"
        },
        {
          "name": "IV",
          "layout": "UltrawideVerticalStack"
        },
        {
          "name": "V",
          "layout": "Rows"
        },
        {
          "name": "VI",
          "layout": "Grid"
        },
        {
          "name": "VII",
          "layout": "RightMainVerticalStack"
        },
        {
          "name": "VIII",
          "layout": "Scrolling"
        }
      ]
    }
  ]
}

Put it where the daemon looks for it, ~/.config/komorebi/komorebi.json, or give it to the daemon with komorebic start --config. Configuration explains every key and where the daemon looks. The settings of a monitor with more than one entry in monitors, and of each workspace, are there too.

Padding

While you can set the workspace padding (the space between the outer edges of the windows and the edge of the monitor) and the container padding (the space between each of the tiled windows) for each workspace on its own, you can also set a default for both of these values that applies to all workspaces, using default_workspace_padding and default_container_padding.

The floating layer

floating_layer_behaviour is Float in the example: a window that opens while a workspace is on its floating layer floats, centered, where the default is to tile it. A window that opens while the workspace is on its tiling layer is tiled either way.

Layouts

BSP

+-------+-----+
|       |     |
|       +--+--+
|       |  |--|
+-------+--+--+

Vertical Stack

+-------+-----+
|       |     |
|       +-----+
|       |     |
+-------+-----+

RightMainVerticalStack

+-----+-------+
|     |       |
+-----+       |
|     |       |
+-----+-------+

Horizontal Stack

+------+------+
|             |
|------+------+
|      |      |
+------+------+

Columns

+--+--+--+--+
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
+--+--+--+--+

Rows

If you have a vertical monitor, I recommend using this layout.

+-----------+
|-----------|
|-----------|
|-----------|
+-----------+

Ultrawide Vertical Stack

If you have an ultrawide monitor, I recommend using this layout.

+-----+-----------+-----+
|     |           |     |
|     |           +-----+
|     |           |     |
|     |           +-----+
|     |           |     |
+-----+-----------+-----+

Grid

If you like the grid layout in LeftWM this is almost exactly the same!

The grid layout does not support resizing windows tiles.

+-----+-----+   +---+---+---+   +---+---+---+   +---+---+---+
|     |     |   |   |   |   |   |   |   |   |   |   |   |   |
|     |     |   |   |   |   |   |   |   |   |   |   |   +---+
+-----+-----+   |   +---+---+   +---+---+---+   +---+---|   |
|     |     |   |   |   |   |   |   |   |   |   |   |   +---+
|     |     |   |   |   |   |   |   |   |   |   |   |   |   |
+-----+-----+   +---+---+---+   +---+---+---+   +---+---+---+
  4 windows       5 windows       6 windows       7 windows