Per-Section Documentation
You can find documentation for various sections of the config:Input
Configure keyboard, mouse, touchpad, and other input devices
Outputs
Set up monitors, resolution, refresh rate, and positioning
Key Bindings
Configure keyboard shortcuts and mouse bindings
Switch Events
Handle laptop lid and tablet mode events
Layout
Control gaps, borders, focus ring, and window arrangement
Window Rules
Customize behavior for specific windows
Loading
Niri will load configuration from the following locations in order:$XDG_CONFIG_HOME/niri/config.kdl~/.config/niri/config.kdl/etc/niri/config.kdl(fallback)
$XDG_CONFIG_HOME/niri/config.kdl with the contents of the default configuration file, which are embedded into the niri binary at build time.
Please use the default configuration file as the starting point for your custom configuration.
Live Reload
The configuration is live-reloaded. Simply edit and save the config file, and your changes will be applied. This includes:- Key bindings
- Output settings like mode
- Window rules
- Everything else
Validation
You can runniri validate to parse the config and see any errors.
Custom Config Path
- Command Line
- Environment Variable
To use a different config file path, pass it in the
--config or -c argument:Syntax
The config is written in KDL.Comments
Lines starting with// are comments and are ignored.
/- in front of a section to comment out the entire section:
Flags
Toggle options in niri are commonly represented as flags. Writing out the flag enables it, and omitting it or commenting it out disables it.Sections
Most sections cannot be repeated. For example:Defaults
Omitting most of the sections of the config file will leave you with the default values for that section.Breaking Change Policy
As a rule, niri updates should not break existing config files. For example, the default config from niri v0.1.0 still parses fine on v25.02. Exceptions can be made for parsing bugs. For example, niri used to accept multiple binds to the same key, but this was not intended and did not do anything (the first bind was always used). A patch release changed niri from silently accepting this to causing a parsing failure.Keep in mind that the breaking change policy applies only to niri releases. Commits between releases can and do occasionally break the config as new features are ironed out.