Skip to content

Layer rules

Syntax

hl.layer_rule({
    name? = str,
    match = {
        prop = some_prop_value,
    },
    effect = some_effect_value,
})

Layer Rules

Some things in Wayland are not windows, but layers — app launchers, status bars, wallpapers, etc. These have separate rules using hl.layer_rule(). The syntax is the same as hl.window_rule().

Props

PropDescriptionType
namespaceNamespace of the layer. Check hyprctl layers[RegEx]

Effects

EffectDescriptionTypeLimits
above_lockIf non-zero, renders the layer above the lock screen. 2 = interactive on lock screenint
animationSets a specific animation style for this layerstr
blurEnables blur for the layerbool
blur_popupsEnables blur for popupsbool
dim_aroundDims everything behind the layerbool
ignore_alphaMakes blur ignore pixels with an opacity equal or lower to thisfloat[0.0 - 1.0]
no_animDisables animationsbool
no_screen_shareHides the layer from screen sharingbool
orderSets the space-reservation order relative to other layers. A higher order layer takes priority when trying to reserve space over other lower order layers. Can be negativeint
xraySets the blur xray mode for the layerbool
Examples
-- Enable blur for Waybar
hl.layer_rule({ match = { namespace = "waybar" }, blur = true })

-- Named layer rule
local selectionRule = hl.layer_rule({
  name    = "no-anim-for-selection",
  match   = { namespace = "selection" },
  no_anim = true,
})

-- Enable blur and ignore_alpha for Rofi
hl.layer_rule({
  match        = { namespace = "rofi" },
  blur         = true,
  ignore_alpha = 0.5,
})

Layer rules also return a handle with set_enabled()/is_enabled():

local myLayerRule = hl.layer_rule({
  name  = "my-layer-rule",
  match = { namespace = "waybar" },
  blur  = true,
})
myLayerRule:set_enabled(false)
Last updated on