Skip to content
Workspace Rules

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

RuleDescriptionTypeLimits
animationThe animation style to use for this workspacestr
monitorBinds a workspace to a monitor. See syntax and Monitorsstr
defaultWhether this workspace should be the default workspace for the given monitorbool
float_gapsSet the gaps for floating windowscss_gaps
gaps_inSet the gaps between windowscss_gaps
gaps_outSet the gaps between windows and monitor edgescss_gaps
border_sizeSet the border size around windowsint
no_borderWhether to disable bordersbool
no_shadowWhether to disable shadowsbool
no_roundingWhether to disable rounded windowsbool
decorateWhether to draw window decorations or notbool
persistentKeep this workspace alive even if empty and inactivebool
on_created_emptyA command to be executed once a workspace is created empty (i.e. not created by moving a window to it). See the command syntaxstr
default_nameA default name for the workspacestr
layoutThe layout to use for this workspacestr
layout_optsA table of layout-specific options for this workspace. Keys and values depend on the layouttable
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