Overview
In thelayout {} section you can change various settings that influence how windows are positioned and sized.
Basic Layout
Gaps
Set gaps around (inside and outside) windows in logical pixels. You can use fractional values. The value will be rounded to physical pixels according to the scale factor of every output. For example,
gaps 0.5 on an output with scale 2 will result in one physical-pixel wide gaps. You can emulate “inner” vs. “outer” gaps with negative struts values.Center Focused Column
When to center a column when changing focus.never: no special centering, focusing an off-screen column will scroll it to the left or right edgealways: the focused column will always be centeredon-overflow: focusing a column will center it if it doesn’t fit on screen together with the previously focused column
Always Center Single Column
If set, niri will always center a single column on a workspace, regardless of thecenter-focused-column option.
Empty Workspace Above First
If set, niri will always add an empty workspace at the very start, in addition to the empty workspace at the very end.Default Column Display
Sets the default display mode for new columns. Can benormal or tabbed.
Column and Window Sizing
Preset Column Widths
Set the widths that theswitch-preset-column-width action (Mod+R) toggles between.
Sets the width as a fraction of the output width, taking gaps into account. For example, you can perfectly fit four windows sized
proportion 0.25 on an output.Sets the window width in logical pixels exactly.
Default Column Width
Set the default width of new windows. The syntax is the same as inpreset-column-widths.
Preset Window Heights
Set the heights that theswitch-preset-window-height action (Mod+Shift+R) toggles between.
Visual Effects
Focus Ring and Border
Focus ring and border are drawn around windows and indicate the active window. They are very similar and have the same options.Focus Ring
Drawn only around the active window
Border
Drawn around all windows and affects their sizes (windows shrink to make space)
Width Configuration
Width Configuration
Set the thickness of the border in logical pixels. You can use fractional values. For example,
width 0.5 on an output with scale 2 will result in one physical-pixel thick borders.Colors
Colors
Colors can be set in a variety of ways:
- CSS named colors:
"red" - RGB hex:
"#rgb","#rgba","#rrggbb","#rrggbbaa" - CSS-like notation:
"rgb(255, 127, 0)","rgba()","hsl()"and a few others
Gradients
Gradients
Similarly to colors, you can set Gradients can be colored relative to windows individually (the default), or to the whole view of the workspace: You can set the gradient interpolation color space:Supported color spaces:
active-gradient and inactive-gradient, which will take precedence.Gradients are rendered the same as CSS linear-gradient(angle, from, to). The angle works the same as in linear-gradient, and is optional, defaulting to 180.srgb (default), srgb-linear, oklab, oklch with hue interpolation options.By default, focus ring and border are rendered as a solid background rectangle behind windows. That is, they will show up through semitransparent windows.If you don’t like that, you should uncomment the
prefer-no-csd setting at the top level of the config.Shadow
Shadow rendered behind a window.Controls the shadow softness/size in logical pixels, same as CSS box-shadow blur radius. Setting
softness 0 will give you hard shadows.Distance to expand the window rectangle in logical pixels, same as CSS box-shadow spread. Spread can be negative.
Moves the shadow relative to the window in logical pixels. For example,
offset x=2 y=2 will move the shadow 2 logical pixels downwards and to the right.Set to
true to make shadows draw behind the window rather than just around it. This fixes shadow artifacts inside CSD rounded corners.The shadow color and opacity.
Override the shadow color for inactive windows. By default, a more transparent
color is used.Tab Indicator
Controls the appearance of the tab indicator that appears next to columns in tabbed display mode.Hide the indicator for tabbed columns that only have a single window
Put the tab indicator “within” the column, rather than outside. This will include it in column sizing and avoid overlaying adjacent columns.
Gap between the tab indicator and the window in logical pixels. Can be negative to put the indicator on top of the window.
Thickness of the indicator in logical pixels
Controls the length of the indicator. Set the
total-proportion property to make tabs take up this much length relative to the window size.Position of the tab indicator relative to the window:
left, right, top, or bottomInsert Hint
Settings for the window insert position hint during an interactive window move.Disables the insert hint altogether
Struts
Struts shrink the area occupied by windows, similarly to layer-shell panels. You can think of them as a kind of outer gaps. They are set in logical pixels.Left and right struts will cause the next window to the side to always peek out slightly. Top and bottom struts will simply add outer gaps in addition to the area occupied by layer-shell panels and regular gaps.
Inner vs. Outer Gaps
Inner vs. Outer Gaps
You can use negative struts with matching gaps value to emulate “inner” vs. “outer” gaps. For example, use this for inner gaps without outer gaps:
Background Color
Set the default background color that niri draws for workspaces. This is visible when you’re not using any background tools like swaybg.You can also set the color per-output in the output config.