komorebi draws no border. KWin's KDE Rounded Corners effect does, outside each window in the gap the layout leaves, and komorebi says how it looks. The window manager describes a Look (a border with a width, a radius and two colors) and asks the backend for it with Backend::apply_look after every event, message and retile. The backend answers whether borders are being drawn, and the layout leaves room around the windows only while they are: a border with no effect to draw it takes none. The KWin backend writes the effect's settings into the user's kwinrc, with every inner outline off (the effect's default draws one over the title bar), loads the effect when borders are on and has it read them again. It unloads the effect and puts the user's settings back when the borders go or komorebi exits. The module installs the effect (effects.borders), which is built to stay unloaded until komorebi asks, and vm-look reads the pixels around two windows in a real session. The session library of the VM tests also waits for the panel of the Plasma shell now: a window komorebi tiles before the panel is made is tiled under it, which hides the bottom of its border from a screenshot. Kde.wait_for_panel_room waits until the daemon's work area is not the whole of its monitor, which is the daemon having learned that the panel takes room, and vm-look calls it where the daemon starts, before the windows open. The shell makes its panel and KWin takes room for it a while later, which the daemon learns of up to a second after, so a daemon that tiles in between puts the windows under the panel and tiles them again, and a screenshot taken between the two shows frames as high as the screen. It is a wait and not a check, since a session that is too slow, as TCG often is, may never take the room. komorebic gets border, border-width and border-offset, and visible-windows. komorebi.json takes the same settings as border, border_width and border_offset, and border_radius, which has no command. The module warns when config asks for borders and the effect is not installed.
5.0 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:
{
"app_specific_configuration_path": "$HOME/.config/komorebi/applications.json",
"cross_monitor_move_behaviour": "Insert",
"default_workspace_padding": 15,
"default_container_padding": 15,
"border": true,
"border_width": 6,
"border_offset": 5,
"floating_window_aspect_ratio": "Widescreen",
"floating_layer_behaviour": "Float",
"resize_delta": 100,
"ignore_rules": [],
"floating_applications": [],
"manage_rules": [],
"monitors": [
{
"workspaces": [
{
"name": "I",
"layout": "BSP",
"initial_workspace_rules": [
// {
// "kind": "Exe",
// "id": "firefox",
// "matching_strategy": "Equals"
// }
]
},
{
"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"
}
]
}
]
}
komorebic quickstart writes it, and the applications.json below, where the daemon looks for
them (Quickstart and autostart). Or put it there yourself,
~/.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.
Application specific configuration
app_specific_configuration_path names a file of rules for the applications that need them, which
the repository has a start of in
komorebic/applications.json. komorebic quickstart puts a copy
where the example says, ~/.config/komorebi/applications.json; a path with no file behind it is
skipped.
Application specific configuration explains the
format.
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