feat(wm): add scrolling layout

This commit adds a new DefaultLayout::Scrolling variant, along with a
new LayoutOptions configuration which will initially be used to allow
the user to declaratively specify the number of visible columns for the
Scrolling layout, and a new komorebic "scrolling-layout-columns" command
to allow the user to modify this value for the focused workspace at
runtime.

The Scrolling layout is inspired by the Niri scrolling window manager,
presenting a workspace as an infinite scrollable horizontal strip with a
viewport which includes the focused window + N other windows in columns.
There is no support for splitting columns into multiple rows.

This layout can currently only be applied to single-monitor setups as
the scrolling would result in layout calculations which push the windows
in the columns moving out of the viewport onto adjacent monitors.

This implementation in the current state is enough to be useable for me
personally, but if others want to iterate on this, make it handle
hiding/restoring windows correctly when scrolling the viewport so that
adjacent monitors don't get impacted etc., patches are always welcome.

resolve #1434
This commit is contained in:
LGUG2Z
2025-05-12 17:13:33 -07:00
parent eec6312a51
commit b4e61b079c
16 changed files with 602 additions and 62 deletions

View File

@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "StaticConfig",
"description": "The `komorebi.json` static configuration file reference for `v0.1.37`",
"description": "The `komorebi.json` static configuration file reference for `v0.1.38`",
"type": "object",
"properties": {
"animation": {
@@ -1790,7 +1790,8 @@
"HorizontalStack",
"UltrawideVerticalStack",
"Grid",
"RightMainVerticalStack"
"RightMainVerticalStack",
"Scrolling"
]
},
"layout_flip": {
@@ -1802,6 +1803,27 @@
"HorizontalAndVertical"
]
},
"layout_options": {
"description": "Layout-specific options (default: None)",
"type": "object",
"properties": {
"scrolling": {
"description": "Options related to the Scrolling layout",
"type": "object",
"required": [
"columns"
],
"properties": {
"columns": {
"description": "Desired number of visible columns (default: 3)",
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
}
}
},
"layout_rules": {
"description": "Layout rules in the format of threshold => layout (default: None)",
"type": "object",
@@ -1815,7 +1837,8 @@
"HorizontalStack",
"UltrawideVerticalStack",
"Grid",
"RightMainVerticalStack"
"RightMainVerticalStack",
"Scrolling"
]
}
},