Files
komorebi/docs/usage/borders.md
T
LGUG2Z 2c35e4bb6f feat(kwin): borders drawn by the compositor
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.
2026-10-28 07:20:49 -07:00

2.9 KiB

Borders

komorebi puts a colored border around every window. It does not draw it: a KWin effect, KDE Rounded Corners, draws the border outside each window, in the gap between the tiles, and komorebi tells the effect how wide it is, how round the corners are and which color to use. The border around the window that has the focus is blue, and the border around every other window is gray.

Installing the effect

The effect is not part of KWin, and KWin finds effects when it starts: log out and in again after installing it. On NixOS the flake's module installs it with komorebi, which is what services.komorebi.effects.borders.enable does (it is on by default); the effect is built so that KWin does not load it until komorebi asks. installation.md has the module's options.

komorebi loads the effect when it starts and borders are on, and unloads it when it exits or the borders are turned off. A machine that does not have the effect has no borders: komorebi says so once in its log, and leaves no room for them.

Turning borders on and off

komorebic border turns borders on or off. They are on by default.

komorebic border disable
komorebic border enable

Width and room

komorebic border-width sets how thick the border is, in pixels: 10 by default. The effect draws at most 20 pixels, and draws the border only where a window has a shadow, so a window with no shadow has no border.

While the borders are drawn, the layout leaves room for them: every tile gives up the width of the border on each side, so that the border is drawn in the gap between two windows and does not fall on the window next to it. komorebic border-offset leaves more room than the width, in pixels, which the effect draws nothing in. With borders off, or without the effect, the layout leaves no room at all. A change of the width or the offset reaches the layout the next time the workspace is tiled again, which komorebic retile does.

komorebic border-width 6
komorebic border-offset 2
komorebic retile

In komorebi.json

The same settings can be in komorebi.json: border, border_width and border_offset are what the three commands above set, and border_radius is how round the corners are, in pixels (10 by default), which has no command. The file sets them when the daemon starts and when the file changes; a key it leaves out leaves the setting as it is.

{
  "border": true,
  "border_width": 6,
  "border_offset": 2,
  "border_radius": 12
}

What is put back

The effect keeps its settings in the user's kwinrc, in the group [Round-Corners]. komorebi writes them when it asks for the border, and when it exits or the borders are turned off it puts back what the user had there, also after a crash: the next run puts them back when it stops.