You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/wiki/Configuration:-Layer-Rules.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,18 @@ layer-rule {
42
42
noise 0.05
43
43
saturation 3
44
44
}
45
+
46
+
popups {
47
+
opacity 0.5
48
+
geometry-corner-radius 6
49
+
50
+
background-effect {
51
+
xray true
52
+
blur true
53
+
noise 0.05
54
+
saturation 3
55
+
}
56
+
}
45
57
}
46
58
```
47
59
@@ -241,3 +253,42 @@ layer-rule {
241
253
}
242
254
}
243
255
```
256
+
257
+
#### `popups`
258
+
259
+
<sup>Since: next release</sup>
260
+
261
+
Override properties for this layer surface's pop-ups (e.g. a menu opened by clicking an item in Waybar).
262
+
263
+
The properties work the same way as the corresponding layer-rule properties, except that they apply to the layer surface's pop-ups rather than to the layer surface itself.
264
+
265
+
`opacity` is applied *on top* of the layer surface's own opacity rule, so setting both will make pop-ups more transparent than the surface.
266
+
Other properties apply independently.
267
+
268
+
> [!NOTE]
269
+
> This block affects only pop-ups created by the app via Wayland's [xdg-popup](https://wayland.app/protocols/xdg-shell#xdg_popup) (which should be most of them).
270
+
>
271
+
> Some desktop shells will emulate pop-ups by drawing something that looks like a pop-up inside a regular layer surface.
272
+
> As far as niri is concerned, those are just layer surfaces and not pop-ups, so this block won't apply to them.
273
+
>
274
+
> This block also does not affect input-method pop-ups, such as Fcitx.
275
+
276
+
```kdl
277
+
// Blur the background behind Waybar popup menus.
278
+
layer-rule {
279
+
match namespace="^waybar$"
280
+
281
+
popups {
282
+
// Match the default GTK 3 popup corner radius.
283
+
geometry-corner-radius 6
284
+
opacity 0.85
285
+
286
+
background-effect {
287
+
blur true
288
+
}
289
+
}
290
+
}
291
+
```
292
+
293
+
Keep in mind that the background effect will look right only if the pop-up is shaped like a (rounded) rectangle, and the layer surface correctly sets its Wayland geometry to exclude any shadows.
294
+
Pop-ups with custom shapes will need the app to implement the [ext-background-effect protocol](https://wayland.app/protocols/ext-background-effect-v1) to work properly.
Copy file name to clipboardExpand all lines: docs/wiki/Configuration:-Window-Rules.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,18 @@ window-rule {
107
107
saturation 3
108
108
}
109
109
110
+
popups {
111
+
opacity 0.5
112
+
geometry-corner-radius 15
113
+
114
+
background-effect {
115
+
xray true
116
+
blur true
117
+
noise 0.05
118
+
saturation 3
119
+
}
120
+
}
121
+
110
122
min-width 100
111
123
max-width 200
112
124
min-height 300
@@ -941,6 +953,67 @@ window-rule {
941
953
}
942
954
```
943
955
956
+
#### `popups`
957
+
958
+
<sup>Since: next release</sup>
959
+
960
+
Override properties for this window's pop-ups (menus and tooltips).
961
+
962
+
The properties work the same way as the corresponding window-rule properties, except that they apply to the window's pop-ups rather than to the window itself.
963
+
964
+
`opacity` is applied *on top* of the layer surface's own opacity rule, so setting both will make pop-ups more transparent than the surface.
965
+
Other properties apply independently.
966
+
967
+
> [!NOTE]
968
+
> This block affects only pop-ups created by the app via Wayland's [xdg-popup](https://wayland.app/protocols/xdg-shell#xdg_popup) (which should be most of them).
969
+
>
970
+
> Examples of things that look like pop-ups that won't work:
971
+
>
972
+
> - Fully emulated by the client, i.e. not a pop-up at all, the client just draws something that looks like a pop-up inside its window.
973
+
> These are common in game engines and in web apps, e.g. the right click menu in Google Docs or in Electron apps like Discord.
974
+
>
975
+
> - Uses a wl-subsurface instead of an xdg-popup.
976
+
> Common in older apps using GTK 3, notably Firefox still uses these for some menus.
977
+
> Subsurfaces are an indivisible part of a surface and they aren't usually pop-ups, so it wouldn't make sense for niri to apply these rules to them.
978
+
>
979
+
> These emulated pop-ups come with other downsides: they cannot reliably extend outside their window, and if the app tries to do that, they will be clipped by rules such as `clip-to-geometry`.
980
+
> So most modern apps will correctly use xdg-popup, which is the intended way to show pop-ups on Wayland.
981
+
>
982
+
> This block also does not affect input-method pop-ups, such as Fcitx.
983
+
>
984
+
> For pop-ups created by your desktop shell or desktop components, use the corresponding [layer rule](./Configuration:-Layer-Rules.md#popups).
985
+
986
+
```kdl
987
+
// Blur the background behind pop-up menus in Nautilus.
988
+
window-rule {
989
+
match app-id="Nautilus"
990
+
991
+
popups {
992
+
// Matches the default libadwaita pop-up corner radius.
993
+
geometry-corner-radius 15
994
+
995
+
// Note: it'll look better to set background opacity
996
+
// through your GTK theme CSS and not here.
997
+
// This is just an example that makes it look obvious.
998
+
opacity 0.5
999
+
1000
+
background-effect {
1001
+
blur true
1002
+
}
1003
+
}
1004
+
}
1005
+
```
1006
+
1007
+
Keep in mind that the background effect will look right only if the pop-up is shaped like a (rounded) rectangle, and the window correctly sets its Wayland geometry to exclude any shadows.
1008
+
For example, GTK 4 pop-ups with pointing arrows (`has-arrow=true` property) are *not* rounded rectangles—the arrow sticks out—so if you enable blur, it will also stick out of the pop-up.
These pop-ups with custom shapes will need the app to implement the [ext-background-effect protocol](https://wayland.app/protocols/ext-background-effect-v1) to work properly.
1016
+
944
1017
#### Size Overrides
945
1018
946
1019
You can amend the window's minimum and maximum size in logical pixels.
Copy file name to clipboardExpand all lines: docs/wiki/Window-Effects.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,10 @@ Blur enabled via the window rule will follow the window corner radius set via [`
40
40
On the other hand, blur enabled through `ext-background-effect` will exactly follow the shape requested by the window.
41
41
If the window or layer has clientside rounded corners or other complex shape, it should set a corresponding blur shape through `ext-background-effect`, then it will get correctly shaped background blur without any manual niri configuration.
42
42
43
+
Windows can also blur their pop-up menus using `ext-background-effect`.
44
+
On the niri side, you can do it with a `popups` block inside [`window-rule`](./Configuration:-Window-Rules.md#popups) and [`layer-rule`](./Configuration:-Layer-Rules.md#popups).
45
+
See those wiki pages for examples and limitations.
46
+
43
47
Global blur settings are configured in the [`blur {}` config section](./Configuration:-Miscellaneous.md#blur) and apply to all background blur.
0 commit comments