diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 13:22:02 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 793e92e9d69f3640754d9ece40ddc7723cf49292 (patch) | |
| tree | 3137096aa90fb1685becf1e78c0b97fbad10f4d8 /wiki | |
| parent | a7c57f4fafabed609ef75b92715beb4e7335d823 (diff) | |
| download | niri-793e92e9d69f3640754d9ece40ddc7723cf49292.tar.gz niri-793e92e9d69f3640754d9ece40ddc7723cf49292.tar.bz2 niri-793e92e9d69f3640754d9ece40ddc7723cf49292.zip | |
Add default-floating-position relative-to property
Diffstat (limited to 'wiki')
| -rw-r--r-- | wiki/Configuration:-Window-Rules.md | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/wiki/Configuration:-Window-Rules.md b/wiki/Configuration:-Window-Rules.md index 6fd5e2a8..131dfac8 100644 --- a/wiki/Configuration:-Window-Rules.md +++ b/wiki/Configuration:-Window-Rules.md @@ -52,7 +52,7 @@ window-rule { block-out-from "screencast" // block-out-from "screen-capture" variable-refresh-rate true - default-floating-position x=100 y=200 + default-floating-position x=100 y=200 relative-to="bottom-left" focus-ring { // off @@ -523,15 +523,22 @@ Afterward, the window will remember its last floating position. By default, new floating windows open at the center of the screen, and windows from the tiling layout open close to their visual screen position. The position uses logical coordinates relative to the working area. +By default, they are relative to the top-left corner of the working area, but you can change this by setting `relative-to` to one of these values: `top-left`, `top-right`, `bottom-left`, `bottom-right`. + For example, if you have a bar at the top, then `x=0 y=0` will put the top-left corner of the window directly below the bar. +If instead you write `x=0 y=0 relative-to="top-right"`, then the top-right corner of the window will align with the top-right corner of the workspace, also directly below the bar. + +The coordinates change direction based on `relative-to`. +For example, by default (top-left), `x=100 y=200` will put the window 100 pixels to the right and 200 pixels down from the top-left corner. +If you use `x=100 y=200 relative-to="bottom-left"`, it will put the window 100 pixels to the right and 200 pixels *up* from the bottom-left corner. ```kdl -// Open the Firefox picture-in-picture window at the top-left corner of the screen +// Open the Firefox picture-in-picture window at the bottom-left corner of the screen // with a small gap. window-rule { match app-id="firefox$" title="^Picture-in-Picture$" - default-floating-position x=32 y=32 + default-floating-position x=32 y=32 relative-to="bottom-left" } ``` |
