Available since version 25.01
match and exclude directives that control which layer-shell surfaces the rule should apply to, and a number of properties that you can set.
Layer rules are processed and work very similarly to window rules, just with different matchers and properties. Please read the window rules documentation to learn how matching works.
Configuration Structure
Here’s an example showing all available matchers and properties:Layer Surface Matching
namespace
A regular expression that should match anywhere in the surface namespace. You can find the namespaces of all open layer-shell surfaces by running
niri msg layers.at-startup
Matches during the first 60 seconds after starting niri. Can be
true or false.Dynamic Properties
These properties apply continuously to open layer-shell surfaces.block-out-from
Block out surfaces from xdg-desktop-portal screencasts or all screen captures. Surfaces will be replaced with solid black rectangles.Options:
"screencast"- Block from screencasts only"screen-capture"- Block from all screen captures
opacity
Set the opacity of the surface.
0.0 is fully transparent, 1.0 is fully opaque. This is applied on top of the surface’s own opacity, so semitransparent surfaces will become even more transparent.shadow
Available since version 25.02
Override the shadow options for the surface. These rules have the same options as the normal shadow config in the layout section.
Unlike window shadows, layer surface shadows always need to be enabled with a layer rule. That is, enabling shadows in the layout config section won’t automatically enable them for layer surfaces.
geometry-corner-radius
Available since version 25.02
Set the corner radius of the surface in logical pixels. This setting will only affect the shadow—it will round its corners to match the geometry corner radius.
place-within-backdrop
Available since version 25.05
Set to
true to place the surface into the backdrop visible in the Overview and between workspaces. This will only work for background layer surfaces that ignore exclusive zones (typical for wallpaper tools). Layers within the backdrop will ignore all input.baba-is-float
Available since version 25.05
Make your layer surfaces FLOAT up and down. This is a natural extension of the April Fools’ 2025 feature.