From 69835b8bcc21b658e0be0ab794c7843650eb9bd0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 12 Sep 2024 12:09:44 +0300 Subject: [PATCH] Add preset window heights to wiki & default config --- resources/default-config.kdl | 6 +++++- wiki/Configuration:-Layout.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/resources/default-config.kdl b/resources/default-config.kdl index ed2d4f0e..d514cc48 100644 --- a/resources/default-config.kdl +++ b/resources/default-config.kdl @@ -113,6 +113,9 @@ layout { // fixed 1920 } + // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. + // preset-window-heights { } + // You can change the default width of the new windows. default-column-width { proportion 0.5; } // If you leave the brackets empty, the windows themselves will decide their initial width. @@ -427,7 +430,8 @@ binds { // Mod+BracketRight { consume-or-expel-window-right; } Mod+R { switch-preset-column-width; } - Mod+Shift+R { reset-window-height; } + Mod+Shift+R { switch-preset-window-height; } + Mod+Ctrl+R { reset-window-height; } Mod+F { maximize-column; } Mod+Shift+F { fullscreen-window; } Mod+C { center-column; } diff --git a/wiki/Configuration:-Layout.md b/wiki/Configuration:-Layout.md index 1b5c4ef9..47be65f8 100644 --- a/wiki/Configuration:-Layout.md +++ b/wiki/Configuration:-Layout.md @@ -17,6 +17,12 @@ layout { default-column-width { proportion 0.5; } + preset-window-heights { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + focus-ring { // off width 4 @@ -134,6 +140,29 @@ layout { > > Either way, `default-column-width {}` is most useful for specific windows, in form of a [window rule](https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules) with the same syntax. +### `preset-window-heights` + +Since: 0.1.9 + +Set the heights that the `switch-preset-window-height` action (Mod+Shift+R) toggles between. + +`proportion` sets the height as a fraction of the output height, taking gaps into account. +The default preset heights are 13, 12 and 23 of the output. + +`fixed` sets the height in logical pixels exactly. + +```kdl +layout { + // Cycle between 1/3, 1/2, 2/3 of the output, and a fixed 720 logical pixels. + preset-window-heights { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + fixed 720 + } +} +``` + ### `focus-ring` and `border` Focus ring and border are drawn around windows and indicate the active window.