Available since version 25.11
Positionality
Includes are positional. They will override options set prior to them. Window rules from included files will be inserted at the position of theinclude line.
Example: Overriding Settings
- The border color is green (from
colors.kdl) - The overview backdrop color is red (it was set after
colors.kdl)
Example: Window Rules Position
Optional Includes
Available since next release
optional=true:
When an optional include file is missing, niri will emit a warning in the logs on every config reload. This reminds you that the file is missing while still loading the config successfully.The optional file is still watched for changes, so if you create it later, the config will automatically reload and apply the new settings.
Merging Behavior
Most config sections are merged between includes, meaning that you can set only a few properties, and only those properties will change.Standard Merging
Multipart Sections
Multipart sections likewindow-rule, output, or workspace are inserted as is without merging:
Binds
binds will override previously-defined conflicting keys:
Flags
Most flags can be disabled withfalse:
Non-merging Sections
Some sections where the contents represent a combined structure are not merged. Examples arestruts, preset-column-widths, individual subsections in animations, pointing device sections in input.
Border Special Case
So, if you want to move your layout configuration from the main config to a separate file, remember to addon to the border section:
The reason for this special case is historical: back when borders were added, there were no
on flags, so writing the border {} section would enable the border, with an explicit off to disable it. Many people likely have this part of the default config embedded in their configs now, so changing how it works would cause confusion.