Workspace Rules
You can set workspace rules to achieve workspace-specific behaviors. For instance, you can define a workspace where all windows are drawn without borders or gaps.
Some layouts have their own specific rules, which can be found on the corresponding layout page. See Layouts.
Syntax
hl.workspace_rule({
workspace = workspace_selector,
rule1 = some_value,
rule2 = other_value,
})Rules
| Rule | Description | Type | Limits |
|---|---|---|---|
| animation | The animation style to use for this workspace | str | |
| monitor | Binds a workspace to a monitor. See syntax and Monitors | str | |
| default | Whether this workspace should be the default workspace for the given monitor | bool | |
| float_gaps | Set the gaps for floating windows | css_gaps | |
| gaps_in | Set the gaps between windows | css_gaps | |
| gaps_out | Set the gaps between windows and monitor edges | css_gaps | |
| border_size | Set the border size around windows | int | |
| no_border | Whether to disable borders | bool | |
| no_shadow | Whether to disable shadows | bool | |
| no_rounding | Whether to disable rounded windows | bool | |
| decorate | Whether to draw window decorations or not | bool | |
| persistent | Keep this workspace alive even if empty and inactive | bool | |
| on_created_empty | 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 | str | |
| default_name | A default name for the workspace | str | |
| layout | The layout to use for this workspace | str | |
| layout_opts | A table of layout-specific options for this workspace. Keys and values depend on the layout | table |
Examples
hl.workspace_rule({ workspace = "3", no_rounding = true, decorate = false })
hl.workspace_rule({ workspace = "name:coding", no_rounding = true, decorate = false, gaps_in = 0, gaps_out = 0, no_border = true, monitor = "DP-1" })
hl.workspace_rule({ workspace = "8", border_size = 8 })
hl.workspace_rule({ workspace = "name:Hello", monitor = "DP-1", default = true })
hl.workspace_rule({ workspace = "name:gaming", monitor = "desc:Chimei Innolux Corporation 0x150C", default = true })
hl.workspace_rule({ workspace = "5", on_created_empty = "[float] firefox" })
hl.workspace_rule({ workspace = "special:scratchpad", on_created_empty = "foot" })
hl.workspace_rule({ workspace = "15", animation = "slidevert", default_name = "slider" })Per-workspace layouts
Use workspace rules to set per-workspace layouts:
hl.workspace_rule({ workspace = "2", layout = "scrolling" })Last updated on