Overview
Mango uses a tag-based workspace system inspired by dwm, offering more flexibility than traditional workspace models. Instead of windows belonging to a single workspace, each window can be assigned to one or multiple tags simultaneously.How Tags Work
Tag Basics
By default, Mango provides 9 tags (numbered 1-9). Think of tags as labels you can apply to windows:- Each window can have multiple tags assigned to it
- You can view one or more tags at a time
- Windows are visible when at least one of their tags matches the currently active tags
The tag system is implemented as a bitmask (
TAGMASK), where each tag corresponds to a bit. This allows efficient operations and multiple tag assignments.Tag vs. Traditional Workspaces
| Traditional Workspaces | Tag System |
|---|---|
| Window belongs to one workspace | Window can have multiple tags |
| Switch between workspaces | Switch between tag views |
| Moving window changes its workspace | Add/remove tags from window |
| Linear navigation | Flexible tag combinations |
Configuring Tags
Each tag can have its own layout and settings defined inconfig.conf:
Working with Tags
Viewing Tags
Switch to a specific tag:Moving Windows to Tags
Assign windows to tags using thetag or tagsilent actions:
The
tag action moves the window and focuses it, while tagsilent moves the window without changing your current view.Multi-Monitor Tag Management
Move windows between monitors while preserving tags:Per-Tag Settings
Mango maintains per-tag settings using thePertag structure. Each tag remembers:
- Layout: The arrangement algorithm (tile, grid, scroller, etc.)
- Master count (
nmaster): Number of windows in the master area - Master factor (
mfact): Size ratio between master and stack areas - Visibility settings: Border rendering, gaps behavior
Tag State Management
The compositor tracks:Tag-Related Window Rules
Automate tag assignments in window rules:Tag Animations
When switching tags, windows animate in and out:- Slide in: Windows entering the view (
tagining) - Slide out: Windows leaving the view (
tagouting) - Direction: Based on
tag_animation_directionsetting
Special Tag States
Global Windows
Windows with theisglobal flag appear on all tags:
- Are visible regardless of the current tag
- Automatically update their tags when you switch views
- Useful for persistent overlays or monitoring tools
Unglobal Windows
Windows withisunglobal are temporarily removed from normal tag visibility without being minimized.
Implementation Details
Tag Bitmask System
Tags are implemented as bit flags:Tag Switching Logic
Theview() function handles tag switching:
- Store current tag as previous tag
- Toggle the tagset selection
- Update monitor’s active tagset
- Trigger arrange to update layout
- Animate windows in/out based on visibility
Best Practices
Tag Organization
Organize tags by purpose:
- Tag 1: General/browsing
- Tag 2: Development
- Tag 3: Communication
- Tag 4: Media
- Tags 5-9: Project-specific
Multi-Tag Workflow
Use multi-tag assignments for:
- Reference windows (documentation)
- Monitoring tools
- Chat/communication apps
- Music players
Common Patterns
Quick Tag Switching
Workflow-Based Tags
Related Concepts
- Layouts - How windows are arranged within each tag
- Window States - Special window modes that interact with tags
- Animations - Tag switching animation behavior
