Skip to main content

Tag Rules

Tag rules allow you to configure per-tag (workspace) settings like default layouts.

Syntax

tagrule=property:value,property:value,...

Available Properties

id
integer
required
Tag ID (1-9)
tagrule=id:1,layout_name:tile
layout_name
enum
required
Default layout for the tagAvailable layouts:
  • tile - Master-stack tiling
  • scroller - Horizontal scrolling layout
  • grid - Grid layout
  • deck - Single window deck
  • monocle - Fullscreen single window
  • center_tile - Centered master with stacks
  • vertical_tile - Vertical master-stack
  • vertical_scroller - Vertical scrolling layout
tagrule=id:1,layout_name:tile

Tag Rule Examples

# Tag 1: Traditional tiling
tagrule=id:1,layout_name:tile

# Tag 2: Scroller layout for browsers
tagrule=id:2,layout_name:scroller

# Tag 3: Grid layout for multiple windows
tagrule=id:3,layout_name:grid

# Tag 4: Monocle for focused work
tagrule=id:4,layout_name:monocle

# Tag 5-9: More layouts
tagrule=id:5,layout_name:deck
tagrule=id:6,layout_name:center_tile
tagrule=id:7,layout_name:vertical_tile
tagrule=id:8,layout_name:vertical_scroller
tagrule=id:9,layout_name:tile

Default Configuration

tagrule=id:1,layout_name:tile
tagrule=id:2,layout_name:tile
tagrule=id:3,layout_name:tile
tagrule=id:4,layout_name:tile
tagrule=id:5,layout_name:tile
tagrule=id:6,layout_name:tile
tagrule=id:7,layout_name:tile
tagrule=id:8,layout_name:tile
tagrule=id:9,layout_name:tile

Layer Rules

Layer rules allow you to configure behavior for specific layer surfaces (overlays, panels, application launchers, etc.).

Syntax

layerrule=property:value,layer_name:name

Available Properties

animation_type_open
enum
Override animation type when opening the layerValues: slide, zoom
layerrule=animation_type_open:zoom,layer_name:rofi
animation_type_close
enum
Override animation type when closing the layerValues: slide, zoom
layerrule=animation_type_close:zoom,layer_name:rofi
layer_name
string
required
Name of the layer surface to targetCommon layer names:
  • rofi - Rofi application launcher
  • waybar - Waybar status bar
  • mako - Mako notification daemon
  • Application-specific names
layerrule=animation_type_open:zoom,layer_name:rofi

Layer Rule Examples

# Rofi launcher with zoom animation
layerrule=animation_type_open:zoom,layer_name:rofi
layerrule=animation_type_close:zoom,layer_name:rofi

# Waybar with slide animation
layerrule=animation_type_open:slide,layer_name:waybar
layerrule=animation_type_close:slide,layer_name:waybar

# Notification daemon
layerrule=animation_type_open:slide,layer_name:mako
layerrule=animation_type_close:slide,layer_name:mako

Finding Layer Names

To find the layer name of an application:
  1. Check the application’s Wayland implementation (usually in documentation)
  2. Use compositor debugging tools
  3. Look at the application’s source code for layer-shell implementation
Common applications and their layer names:
ApplicationLayer Name
Rofirofi
Waybarwaybar
Makomako
Dunstdunst
Swaylockswaylock

Layout Descriptions

Tile

Traditional master-stack layout. One or more master windows on the left, stack on the right. Layout-specific settings:
# New windows become master
new_is_master=1

# Master area takes 55% of width
default_mfact=0.55

# Number of windows in master area
default_nmaster=1

Scroller

Horizontal scrolling layout where windows are arranged side-by-side. Layout-specific settings:
# Number of visible windows
scroller_structs=20

# Default window width ratio
scroller_default_proportion=0.8

# Center focused window
scroller_focus_center=0

# Prefer centered positioning
scroller_prefer_center=0

# Focus window under pointer at screen edge
edge_scroller_pointer_focus=1

# Single window proportion
scroller_default_proportion_single=1.0

# Preset proportions
scroller_proportion_preset=0.5,0.8,1.0

Grid

Arranges windows in a grid pattern.

Deck

Stacks windows like a deck of cards, showing only the top window.

Monocle

Maximizes a single window at a time.

Center Tile

Centered master area with stack windows on both sides.

Vertical Tile

Master-stack layout with vertical split (master on top).

Vertical Scroller

Vertical scrolling layout where windows are stacked vertically.

Layout-Specific Configuration

Master-Stack Layouts

# New windows become master (applies to tile, vertical_tile, center_tile)
new_is_master=1

# Master area fraction (0.0 - 1.0)
default_mfact=0.55

# Number of master windows
default_nmaster=1

# Hide gaps when single window
smartgaps=0

Scroller Layouts

# Scroller structure settings
scroller_structs=20
scroller_default_proportion=0.8
scroller_focus_center=0
scroller_prefer_center=0
edge_scroller_pointer_focus=1
scroller_default_proportion_single=1.0
scroller_proportion_preset=0.5,0.8,1.0

Keybindings for Scroller

# Set proportion to 1.0 (full width)
bind=ALT,e,set_proportion,1.0

# Cycle through proportion presets
bind=ALT,x,switch_proportion_preset,

Complete Rules Example

# Tag rules - different layouts for different workflows
tagrule=id:1,layout_name:tile              # General work
tagrule=id:2,layout_name:scroller          # Browsing
tagrule=id:3,layout_name:grid              # Monitoring
tagrule=id:4,layout_name:monocle           # Focus
tagrule=id:5,layout_name:tile              # Development
tagrule=id:6,layout_name:center_tile       # Writing
tagrule=id:7,layout_name:vertical_scroller # Terminals
tagrule=id:8,layout_name:deck              # Media
tagrule=id:9,layout_name:tile              # Misc

# Layer rules - custom animations for different surfaces
layerrule=animation_type_open:zoom,layer_name:rofi
layerrule=animation_type_close:zoom,layer_name:rofi
layerrule=animation_type_open:slide,layer_name:waybar
layerrule=animation_type_close:slide,layer_name:waybar

# Master-stack settings
new_is_master=1
default_mfact=0.55
default_nmaster=1
smartgaps=0

# Scroller settings
scroller_structs=20
scroller_default_proportion=0.8
scroller_focus_center=0
scroller_prefer_center=0
edge_scroller_pointer_focus=1
scroller_default_proportion_single=1.0
scroller_proportion_preset=0.5,0.8,1.0

Switching Layouts

You can switch layouts at runtime:
# Cycle through available layouts
bind=SUPER,n,switch_layout
This keybinding cycles through all available layouts for the current tag.

Future Rule Types

Mango may support additional rule types in future versions, such as:
  • Window rules based on app_id or title
  • Monitor-specific rules
  • Per-window opacity and blur settings
Check the Mango Wiki for updates on new rule types.

Build docs developers (and LLMs) love