wiki: Document per-output and per-workspace layout overrides

This commit is contained in:
Ivan Molodetskikh
2025-09-27 09:31:21 +03:00
parent f975672255
commit 264289cd41
3 changed files with 116 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ layout {
focus-ring { focus-ring {
// off // off
on
width 4 width 4
active-color "#7fc8ff" active-color "#7fc8ff"
inactive-color "#505050" inactive-color "#505050"
@@ -40,6 +41,7 @@ layout {
border { border {
off off
// on
width 4 width 4
active-color "#ffc87f" active-color "#ffc87f"
inactive-color "#505050" inactive-color "#505050"
@@ -50,6 +52,7 @@ layout {
} }
shadow { shadow {
off
// on // on
softness 30 softness 30
spread 5 spread 5
@@ -61,6 +64,7 @@ layout {
tab-indicator { tab-indicator {
// off // off
on
hide-when-single-tab hide-when-single-tab
place-within-column place-within-column
gap 5 gap 5
@@ -79,6 +83,7 @@ layout {
insert-hint { insert-hint {
// off // off
on
color "#ffc87f80" color "#ffc87f80"
// gradient from="#ffbb6680" to="#ffc88080" angle=45 relative-to="workspace-view" // gradient from="#ffbb6680" to="#ffc88080" angle=45 relative-to="workspace-view"
} }
@@ -92,6 +97,8 @@ layout {
} }
``` ```
<sup>Since: next release</sup> You can override these settings for specific [outputs](./Configuration:-Outputs.md#layout-config-overrides) and [named workspaces](./Configuration:-Named-Workspaces.md#layout-config-overrides).
### `gaps` ### `gaps`
Set gaps around (inside and outside) windows in logical pixels. Set gaps around (inside and outside) windows in logical pixels.
@@ -550,4 +557,4 @@ layout {
} }
``` ```
You can also set the color per-output [in the output config](./Configuration:-Outputs.md#background-color). You can also set the color per-output [in the output config](./Configuration:-Outputs.md#layout-config-overrides).

View File

@@ -45,3 +45,53 @@ Before, it could only use the connector name.
<sup>Since: 25.02</sup> Named workspaces no longer update/forget their original output when opening a new window on them (unnamed workspaces will keep doing that). <sup>Since: 25.02</sup> Named workspaces no longer update/forget their original output when opening a new window on them (unnamed workspaces will keep doing that).
This means that named workspaces "stick" to their original output in more cases, reflecting their more permanent nature. This means that named workspaces "stick" to their original output in more cases, reflecting their more permanent nature.
Explicitly moving a named workspace to a different monitor will still update its original output. Explicitly moving a named workspace to a different monitor will still update its original output.
### Layout config overrides
<sup>Since: next release</sup>
You can customize layout settings for named workspaces with a `layout {}` block:
```kdl
workspace "aesthetic" {
// Layout config overrides just for this named workspace.
layout {
gaps 32
struts {
left 64
right 64
bottom 64
top 64
}
border {
on
width 4
}
// ...any other setting.
}
}
```
It accepts all the same options as [the top-level `layout {}` block](./Configuration:-Layout.md), except:
- `empty-workspace-above-first`: this is an output-level setting, doesn't make sense on a workspace.
- `insert-hint`: currently we always draw these at the output level, so it's not customizable per-workspace.
In order to unset a flag, write it with `false`, e.g.:
```kdl
layout {
// Enabled globally.
always-center-single-column
}
workspace "uncentered" {
layout {
// Unset on this workspace.
always-center-single-column false
}
}
```

View File

@@ -14,7 +14,6 @@ output "eDP-1" {
position x=1280 y=0 position x=1280 y=0
variable-refresh-rate // on-demand=true variable-refresh-rate // on-demand=true
focus-at-startup focus-at-startup
background-color "#003300"
backdrop-color "#001100" backdrop-color "#001100"
hot-corners { hot-corners {
@@ -24,6 +23,10 @@ output "eDP-1" {
// bottom-left // bottom-left
// bottom-right // bottom-right
} }
layout {
// ...layout settings for eDP-1...
}
} }
output "HDMI-A-1" { output "HDMI-A-1" {
@@ -205,6 +208,8 @@ This is visible when you're not using any background tools like swaybg.
<sup>Until: 25.05</sup> The alpha channel for this color will be ignored. <sup>Until: 25.05</sup> The alpha channel for this color will be ignored.
<sup>Since: next release</sup> This setting is deprecated, set `background-color` in the [output `layout {}` block](#layout-config-overrides) instead.
```kdl ```kdl
output "HDMI-A-1" { output "HDMI-A-1" {
background-color "#003300" background-color "#003300"
@@ -253,3 +258,55 @@ output "DP-2" {
} }
} }
``` ```
### Layout config overrides
<sup>Since: next release</sup>
You can customize layout settings for an output with a `layout {}` block:
```kdl
output "SomeCompany VerticalMonitor 1234" {
transform "90"
// Layout config overrides just for this output.
layout {
default-column-width { proportion 1.0; }
// ...any other setting.
}
}
output "SomeCompany UltrawideMonitor 1234" {
// Narrower proportions and more presets for an ultrawide.
layout {
default-column-width { proportion 0.25; }
preset-column-widths {
proportion 0.2
proportion 0.25
proportion 0.5
proportion 0.75
proportion 0.8
}
}
}
```
It accepts all the same options as [the top-level `layout {}` block](./Configuration:-Layout.md).
In order to unset a flag, write it with `false`, e.g.:
```kdl
layout {
// Enabled globally.
always-center-single-column
}
output "eDP-1" {
layout {
// Unset on this output.
always-center-single-column false
}
}
```