From 555e2e97da574ab710e7153cc0f357ae091fba5e Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 12:41:30 -0700 Subject: [PATCH] docs(schema): the schemas and the command help for the scrolling layout schema.json gets center_focused_column as a boolean or one of Never, Always and OnOverflow, the options of the module follow it, and docs/cli has the new commands. --- docs/cli/center-focus.md | 10 +++++++ docs/cli/consume.md | 14 +++++++++ docs/cli/expand.md | 11 +++++++ docs/cli/expel.md | 11 +++++++ docs/cli/pan.md | 17 +++++++++++ docs/cli/scrolling-layout-full-width.md | 11 +++++++ docs/cli/toggle-column-stack.md | 11 +++++++ nix/komorebi-options.nix | 20 +++++++++++-- schema.json | 38 +++++++++++++++++++++---- 9 files changed, 135 insertions(+), 8 deletions(-) create mode 100644 docs/cli/center-focus.md create mode 100644 docs/cli/consume.md create mode 100644 docs/cli/expand.md create mode 100644 docs/cli/expel.md create mode 100644 docs/cli/pan.md create mode 100644 docs/cli/scrolling-layout-full-width.md create mode 100644 docs/cli/toggle-column-stack.md diff --git a/docs/cli/center-focus.md b/docs/cli/center-focus.md new file mode 100644 index 00000000..2ba9eab9 --- /dev/null +++ b/docs/cli/center-focus.md @@ -0,0 +1,10 @@ +```text +Scroll the Scrolling layout so that the focused column is in the middle of the screen, once + +Usage: center-focus + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/consume.md b/docs/cli/consume.md new file mode 100644 index 00000000..3b7509fb --- /dev/null +++ b/docs/cli/consume.md @@ -0,0 +1,14 @@ +```text +Take the neighbouring window on one side into the focused column of the Scrolling layout + +Usage: consume + +Arguments: + + [possible values: left, right, up, down] + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/expand.md b/docs/cli/expand.md new file mode 100644 index 00000000..7d0839fe --- /dev/null +++ b/docs/cli/expand.md @@ -0,0 +1,11 @@ +```text +Make the focused column of the Scrolling layout fill the room that the columns in view leave on the +screen, which does nothing in any other layout + +Usage: expand + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/expel.md b/docs/cli/expel.md new file mode 100644 index 00000000..2542d84f --- /dev/null +++ b/docs/cli/expel.md @@ -0,0 +1,11 @@ +```text +Take the focused window out of its column in the Scrolling layout and put it in a column of its own +on the right + +Usage: expel + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/pan.md b/docs/cli/pan.md new file mode 100644 index 00000000..bea604a7 --- /dev/null +++ b/docs/cli/pan.md @@ -0,0 +1,17 @@ +```text +Move the view of the Scrolling layout a column to the left or the right, which does nothing in any +other layout + +Usage: pan + +Arguments: + + The way that the view goes + + [possible values: left, right] + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/scrolling-layout-full-width.md b/docs/cli/scrolling-layout-full-width.md new file mode 100644 index 00000000..27670c4e --- /dev/null +++ b/docs/cli/scrolling-layout-full-width.md @@ -0,0 +1,11 @@ +```text +Make the focused column of the Scrolling layout as wide as the screen, or put it back to the width +that it had + +Usage: scrolling-layout-full-width + +Options: + -h, --help + Print help + +``` diff --git a/docs/cli/toggle-column-stack.md b/docs/cli/toggle-column-stack.md new file mode 100644 index 00000000..b761992f --- /dev/null +++ b/docs/cli/toggle-column-stack.md @@ -0,0 +1,11 @@ +```text +Stack the windows of the focused column of the Scrolling layout, or spread the focused stack out +into a column with a window in each slot + +Usage: toggle-column-stack + +Options: + -h, --help + Print help + +``` diff --git a/nix/komorebi-options.nix b/nix/komorebi-options.nix index 3979bda8..4caa97e1 100644 --- a/nix/komorebi-options.nix +++ b/nix/komorebi-options.nix @@ -1,4 +1,4 @@ -# schema-sha256: 03b13ffd266a4432379c1dc2dc69b84b180484acd196ffda7dd436e511ad4170 +# schema-sha256: b12084cc7a60e3c4502f56bf4f9c72cee957324c21ec9d6b17890243143da1fd { lib, ... }: let animationStyle = ( @@ -212,9 +212,16 @@ let lib.types.submodule { options = { center_focused_column = lib.mkOption { - type = (lib.types.nullOr lib.types.bool); + type = ( + lib.types.nullOr ( + lib.types.oneOf [ + lib.types.bool + scrollingCentering + ] + ) + ); default = null; - description = "With an odd number of visible columns, keep the focused window column centered"; + description = "When to centre the focused column: `Never` (the default), `Always`, or `OnOverflow`, which\nis when it does not fit on the screen together with the column that focus came from. A\nboolean is also accepted, where `true` is `Always` and `false` is `Never`"; }; columns = lib.mkOption { type = lib.types.int; @@ -272,6 +279,13 @@ let }; } ); + scrollingCentering = ( + lib.types.enum [ + "Never" + "Always" + "OnOverflow" + ] + ); wallpaper = ( lib.types.submodule { options = { diff --git a/schema.json b/schema.json index d492d3bb..118bd717 100644 --- a/schema.json +++ b/schema.json @@ -3507,16 +3507,44 @@ "b" ] }, + "ScrollingCentering": { + "description": "When the Scrolling layout centres the focused column\n\nA boolean is also accepted when reading, for the layout option that used to be one: `true` is\n`Always` and `false` is `Never`.", + "oneOf": [ + { + "description": "Scroll just far enough to bring the focused column into view, and no further", + "type": "string", + "const": "Never" + }, + { + "description": "Keep the focused column in the middle of the screen", + "type": "string", + "const": "Always" + }, + { + "description": "Centre the focused column when it does not fit on the screen together with the column that\nfocus came from", + "type": "string", + "const": "OnOverflow" + } + ] + }, "ScrollingLayoutOptions": { "description": "Options for the Scrolling layout", "type": "object", "properties": { "center_focused_column": { - "description": "With an odd number of visible columns, keep the focused window column centered", - "type": [ - "boolean", - "null" - ] + "description": "When to centre the focused column: `Never` (the default), `Always`, or `OnOverflow`, which\nis when it does not fit on the screen together with the column that focus came from. A\nboolean is also accepted, where `true` is `Always` and `false` is `Never`", + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/$defs/ScrollingCentering" + }, + { + "type": "null" + } + ], + "default": null }, "columns": { "description": "Desired number of visible columns (default: 3)",