From 3c2e1554c6f1fe0d7d96094aa93f72f4ced613e5 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 29 Dec 2024 10:39:21 +0300 Subject: Add default-floating-position window rule --- wiki/Configuration:-Window-Rules.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'wiki') diff --git a/wiki/Configuration:-Window-Rules.md b/wiki/Configuration:-Window-Rules.md index d39140ff..8dc7c4be 100644 --- a/wiki/Configuration:-Window-Rules.md +++ b/wiki/Configuration:-Window-Rules.md @@ -52,6 +52,7 @@ window-rule { block-out-from "screencast" // block-out-from "screen-capture" variable-refresh-rate true + default-floating-position x=100 y=200 focus-ring { // off @@ -507,6 +508,29 @@ window-rule { } ``` +#### `default-floating-position` + +Since: next release + +Set the initial position for this window when it opens on, or moves to the floating layout. + +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. +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. + +```kdl +// Open the Firefox picture-in-picture window at the top-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 +} +``` + #### `draw-border-with-background` Override whether the border and the focus ring draw with a background. -- cgit