layouts: add new layout rewrite stuff (#1374)

* layouts: add new layout rewrite stuff

* fix

* Update content/Configuring/Monocle-Layout.md

Co-authored-by: Dregu <ville.nousiainen@gmail.com>

---------

Co-authored-by: Dregu <ville.nousiainen@gmail.com>
This commit is contained in:
Vaxry 2026-02-21 21:31:04 +00:00 committed by GitHub
parent 4dffa196bb
commit efbb692675
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 107 additions and 14 deletions

View file

@ -59,7 +59,6 @@ layout pages (See the sidebar).
| tagwindow | apply tag to current or the first window matching | `tag [window]`, e.g. `+code ^(foot)$`, `music` |
| focuswindow | focuses the first window matching | window |
| focusmonitor | focuses a monitor | monitor |
| splitratio | changes the split ratio | floatvalue |
| movecursortocorner | moves the cursor to the corner of the active window | direction, 0 - 3, bottom left - 0, bottom right - 1, top right - 2, top left - 3 |
| movecursor | moves the cursor to a specified position | `x y` |
| renameworkspace | rename a workspace | `id name`, e.g. `2 work` |

View file

@ -30,8 +30,6 @@ category name: `dwindle`
| default_split_ratio | the default split ratio on window open. 1 means even 50/50 split. [0.1 - 1.9] | float | 1.0 |
| split_bias | specifies which window will receive the split ratio. 0 -> directional (the top or left window), 1 -> the current window | int | 0 |
| precise_mouse_move | bindm movewindow will drop the window more precisely depending on where your mouse is. | bool | false |
| single_window_aspect_ratio | whenever only a single window is shown on a screen, add padding so that it conforms to the specified aspect ratio. A value like `4 3` on a 16:9 screen will make it a 4:3 window in the middle with padding to the sides. | Vec2D | 0 0 |
| single_window_aspect_ratio_tolerance | sets a tolerance for `single_window_aspect_ratio`, so that if the padding that would have been added is smaller than the specified fraction of the height or width of the screen, it will not attempt to adjust the window size [0 - 1] | int | 0.1 |
## Bind Dispatchers

View file

@ -1,5 +1,5 @@
---
weight: 18
weight: 34
title: Environment variables
---

View file

@ -1,5 +1,5 @@
---
weight: 21
weight: 37
title: Example configurations
---

View file

@ -1,5 +1,5 @@
---
weight: 16
weight: 32
title: Expanding functionality
---

View file

@ -0,0 +1,20 @@
---
weight: 14
title: Monocle Layout
---
Monocle is a layout where windows are always taking up the entire available space.
## Quirks
Due to how layouts work, `cyclenext` will not work with Monocle. For cycling monocle
windows, either use `layoutmsg, cyclenext` or `cyclenext, tiled`.
## Layout messages
Dispatcher `layoutmsg` params:
| name | description | params |
| --- | --- | --- |
| cyclenext | cycle to the next window | none |
| cycleprev | cycle to the previous window | none |

View file

@ -1,5 +1,5 @@
---
weight: 19
weight: 35
title: Multi-GPU
---

View file

@ -1,5 +1,5 @@
---
weight: 22
weight: 38
title: Performance
---

View file

@ -1,5 +1,5 @@
---
weight: 14
weight: 30
title: Permissions
---

View file

@ -0,0 +1,59 @@
---
weight: 13
title: Scrolling Layout
---
Scrolling is a layout where windows get positioned on an infinitely growing tape.
## Config
category name: `scrolling`
| name | description | type | default |
| --- | --- | --- | --- |
|fullscreen_on_one_column|when enabled, a single column on a workspace will always span the entire screen. | bool | true |
| column_width | the default width of a column, [0.1 - 1.0]. | float | 0.5 |
| focus_fit_method | When a column is focused, what method should be used to bring it into view. 0 = center, 1 = fit | int | 0 |
| follow_focus | when a window is focused, should the layout move to bring it into view automatically | bool | true |
| follow_min_visible | when a window is focused, require that at least a given fraction of it is visible for focus to follow. Hard input (e.g. binds, clicks) will always follow. [0.0 - 1.0] | float | 0.4 |
| explicit_column_widths | A comma-separated list of preconfigured widths for colresize +conf/-conf | str | 0.333, 0.5, 0.667, 1.0 |
| direction | Direction in which new windows appear and the layout scrolls. left/right/down/up | str | right |
## Workspace rules
| name | description | type |
| --- | --- | --- |
| direction | Same as scrolling:direction | str |
e.g.
```ini
workspace = 2, layoutopt:direction:right
```
## Layout messages
Dispatcher `layoutmsg` params:
| name | description | params |
| --- | --- | --- |
| move | move the layout horizontally, by either a relative logical px (`-200`, `+200`) or columns (`+col`, `-col`) | move data |
| colresize | resize the current column, to either a value or by a relative value e.g. `0.5`, `+0.2`, `-0.2` or cycle the preconfigured ones with `+conf` or `-conf`. Can also be `all (number)` for resizing all columns to a specific width | relative float / relative conf |
| movewindowto | same as the movewindow dispatcher but supports promotion to the right at the end | direction |
| fit | executes a fit operation based on the argument. Available: `active`, `visible`, `all`, `toend`, `tobeg` | fit mode |
| focus | moves the focus and centers the layout, while also wrapping instead of moving to neighbring monitors. | direction |
| promote | moves a window to its own new column | none |
| swapcol | Swaps the current column with its neighbor to the left (`l`) or right (`r`). The swap wraps around (e.g., swapping the first column left moves it to the end). | `l` or `r` |
| movecoltoworkspace | Moves the entire current column to the specified workspace, preserving its internal layout. Works with existing, new, and special workspaces. e.g. like `1`, `2`, `-1`, `+2`, `special`, etc. | workspace identifier|
| togglefit | Toggle the focus_fit_method (center, fit) | none |
Example key bindings for your Hyprland config:
```
bind = $mainMod, period, layoutmsg, move +col
bind = $mainMod, comma, layoutmsg, move -col
bind = $mainMod SHIFT, period, layoutmsg, movewindowto r
bind = $mainMod SHIFT, comma, layoutmsg, movewindowto l
bind = $mainMod SHIFT, up, layoutmsg, movewindowto u
bind = $mainMod SHIFT, down, layoutmsg, movewindowto d
```

View file

@ -1,5 +1,5 @@
---
weight: 20
weight: 36
title: Uncommon tips & tricks
---
@ -406,3 +406,11 @@ someValue = 0.52
The -git branch exports the variable for the next major release.
All future releases will export all _past_ variables as well, e.g. 0.54 will also export 0.53.
## Per-workspace layouts
Use workspace rules to set per-workspace layouts:
```ini
workspace = 2, layout:scrolling
```

View file

@ -1,5 +1,5 @@
---
weight: 15
weight: 31
title: Using hyprctl
---

View file

@ -55,7 +55,7 @@ the layout pages and not here. (See the Sidebar for Dwindle and Master layouts)
| col.active_border | border color for the active window | gradient | 0xffffffff |
| col.nogroup_border | inactive border color for window that cannot be added to a group (see `denywindowfromgroup` dispatcher) | gradient | 0xffffaaff |
| col.nogroup_border_active | active border color for window that cannot be added to a group | gradient | 0xffff00ff |
| layout | which layout to use. [dwindle/master] | str | dwindle |
| layout | which layout to use. \[dwindle/master/scrolling/monocle\] | str | dwindle |
| no_focus_fallback | if true, will not fall back to the next available window when moving focus in a direction where no window was found | bool | false |
| resize_on_border | enables resizing windows by clicking and dragging on borders and gaps | bool | false |
| extend_border_grab_area | extends the area around the border where you can click and drag on, only used when `general:resize_on_border` is on. | int | 15 |
@ -432,6 +432,15 @@ _Subcategory `misc:`_
| size_limits_tiled | whether to apply min_size and max_size rules to tiled windows | bool | false |
| disable_watchdog_warning | whether to disable the warning about not using start-hyprland | bool | false |
### Layout
_Subcategory `layout:`_
| name | description | type | default |
|---|---|---|---|
| single_window_aspect_ratio | whenever only a single window is shown on a screen, add padding so that it conforms to the specified aspect ratio. A value like `4 3` on a 16:9 screen will make it a 4:3 window in the middle with padding to the sides. | Vec2D | 0 0 |
| single_window_aspect_ratio_tolerance | sets a tolerance for `single_window_aspect_ratio`, so that if the padding that would have been added is smaller than the specified fraction of the height or width of the screen, it will not attempt to adjust the window size [0 - 1] | int | 0.1 |
### Binds
_Subcategory `binds:`_
@ -449,7 +458,6 @@ _Subcategory `binds:`_
| movefocus_cycles_fullscreen | If enabled, when on a fullscreen window, `movefocus` will cycle fullscreen, if not, it will move the focus in a direction. | bool | false |
| movefocus_cycles_groupfirst | If enabled, when in a grouped window, movefocus will cycle windows in the groups first, then at each ends of tabs, it'll move on to other windows/groups | bool | false |
| disable_keybind_grabbing | If enabled, apps that request keybinds to be disabled (e.g. VMs) will not be able to do so. | bool | false |
| window_direction_monitor_fallback | If enabled, moving a window or focus over the edge of a monitor with a direction will move it to the next monitor in that direction. | bool | true |
| allow_pin_fullscreen | If enabled, Allow fullscreen to pinned windows, and restore their pinned status afterwards | bool | false |
| drag_threshold | Movement threshold in pixels for window dragging and c/g bind flags. 0 to disable and grab on mousedown. | int | 0 |

View file

@ -97,6 +97,7 @@ windowrule = rounding 0, match:float 0, match:workspace f[1]s[false]
| persistent:[b] | Keep this workspace alive even if empty and inactive | bool |
| on-created-empty:[c] | A command to be executed once a workspace is created empty (i.e. not created by moving a window to it). See the [command syntax](../Dispatchers#executing-with-rules) | string |
| defaultName:[s] | A default name for the workspace. | string |
| layout:[s] | The layout to use for this workspace. | string |
### Example Rules

View file

@ -1,5 +1,5 @@
---
weight: 17
weight: 33
title: XWayland
---