diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-21 09:40:00 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-21 11:31:30 +0300 |
| commit | acd4cb51aa0e013bfec14444ee48a01c60ebaf8a (patch) | |
| tree | 8530bbe3697d4af8a6e6391e5be5997a4b68c6f4 /wiki | |
| parent | 5ebcae997e672dcf0b9c73da383fa40f55a85fcc (diff) | |
| download | niri-acd4cb51aa0e013bfec14444ee48a01c60ebaf8a.tar.gz niri-acd4cb51aa0e013bfec14444ee48a01c60ebaf8a.tar.bz2 niri-acd4cb51aa0e013bfec14444ee48a01c60ebaf8a.zip | |
Implement shadows for layer surfaces
Diffstat (limited to 'wiki')
| -rw-r--r-- | wiki/Configuration:-Layer-Rules.md | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/wiki/Configuration:-Layer-Rules.md b/wiki/Configuration:-Layer-Rules.md index 297991e3..3bf262c9 100644 --- a/wiki/Configuration:-Layer-Rules.md +++ b/wiki/Configuration:-Layer-Rules.md @@ -19,6 +19,19 @@ layer-rule { opacity 0.5 block-out-from "screencast" // block-out-from "screen-capture" + + shadow { + on + // off + softness 40 + spread 5 + offset x=0 y=5 + draw-behind-window true + color "#00000064" + // inactive-color "#00000064" + } + + geometry-corner-radius 12 } ``` @@ -95,3 +108,48 @@ layer-rule { opacity 0.95 } ``` + +#### `shadow` + +<sup>Since: next release</sup> + +Override the shadow options for the surface. + +These rules have the same options as the normal shadow config in the [layout](./Configuration:-Layout.md) section, so check the documentation there. + +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. + +> [!NOTE] +> Layer surfaces have no way to tell niri about their *visual geometry*. +> For example, if a layer surface includes some invisible margins (like mako), niri has no way of knowing that, and will draw the shadow behind the entire surface, including the invisible margins. +> +> So to use niri shadows, you'll need to configure layer-shell clients to remove their own margins or shadows. + +```kdl +// Add a shadow for fuzzel. +layer-rule { + match namespace="^launcher$" + + shadow { + on + } + + // Fuzzel defaults to 10 px rounded corners. + geometry-corner-radius 10 +} +``` + +#### `geometry-corner-radius` + +<sup>Since: next release</sup> + +Set the corner radius of the surface. + +This setting will only affect the shadow—it will round its corners to match the geometry corner radius. + +```kdl +layer-rule { + geometry-corner-radius 12 +} +``` |
