diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-01 19:06:08 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-02 14:27:53 +0400 |
| commit | 42cef79c699c0f03b4bb99c4278169c48d9a5bd0 (patch) | |
| tree | 630d18b49f3d93603a79bcfc5734dc773c6d0cb6 /wiki/Configuration:-Window-Rules.md | |
| parent | d86df5025cfd26ef4a3c48acd8ee80555265ee53 (diff) | |
| download | niri-42cef79c699c0f03b4bb99c4278169c48d9a5bd0.tar.gz niri-42cef79c699c0f03b4bb99c4278169c48d9a5bd0.tar.bz2 niri-42cef79c699c0f03b4bb99c4278169c48d9a5bd0.zip | |
Implement rounded window corners
Diffstat (limited to 'wiki/Configuration:-Window-Rules.md')
| -rw-r--r-- | wiki/Configuration:-Window-Rules.md | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/wiki/Configuration:-Window-Rules.md b/wiki/Configuration:-Window-Rules.md index 289f1b1c..6cdb2320 100644 --- a/wiki/Configuration:-Window-Rules.md +++ b/wiki/Configuration:-Window-Rules.md @@ -59,6 +59,9 @@ window-rule { // Same as focus-ring. } + geometry-corner-radius 12 + clip-to-geometry true + min-width 100 max-width 200 min-height 300 @@ -378,6 +381,77 @@ window-rule { } ``` +#### `geometry-corner-radius` + +<sup>Since: 0.1.6</sup> + +Set the corner radius of the window. + +On its own, this setting will only affect the border and the focus ring—they will round their corners to match the geometry corner radius. +If you'd like to force-round the corners of the window itself, set `clip-to-geometry true` in addition to this setting. + +``` +window-rule { + geometry-corner-radius 12 +} +``` + +The radius is set in logical pixels, and controls the radius of the window itself, that is, the inner radius of the border: + + + +Instead of one radius, you can set four, for each corner. +The order is the same as in CSS: top-left, top-right, bottom-right, bottom-left. + +``` +window-rule { + geometry-corner-radius 8 8 0 0 +} +``` + +This way, you can match GTK 3 applications which have square bottom corners: + + + +#### `clip-to-geometry` + +<sup>Since: 0.1.6</sup> + +Clips the window to its visual geometry. + +This will cut out any client-side window shadows, and also round window corners according to `geometry-corner-radius`. + + + +``` +window-rule { + clip-to-geometry true +} +``` + +Enable border, set `geometry-corner-radius` and `clip-to-geometry`, and you've got a classic setup: + + + +``` +prefer-no-csd + +layout { + focus-ring { + off + } + + border { + width 2 + } +} + +window-rule { + geometry-corner-radius 12 + clip-to-geometry true +} +``` + #### Size Overrides You can amend the window's minimum and maximum size in logical pixels. |
