mmsg utility is Mango’s IPC client for querying and controlling the compositor. It supports three operation modes: get, set, and watch.
Synopsis
Operation Modes
-g Get Mode
Query current compositor state once and exit.
-s Set Mode
Modify compositor state and exit.
-w Watch Mode
Continuously stream compositor events. Useful for status bars.
General Options
-O Get Output Names
List all connected outputs (monitors).
-T Get Tag Count
Return the number of configured tags.
-L Get Layouts
List all available layouts.
-q Quit Compositor
Instruct Mango to quit.
-o <output> Select Output
Target a specific output. Without this, operations target the active output.
Get Options
-o Output Focus
Show which output is currently focused (selected monitor).
-t Tag Information
Get detailed tag state: occupancy, selection, and urgency.
tag <n> <state> <clients> <focused>n: tag number (1-indexed)state: 0=none, 1=active, 2=urgentclients: client countfocused: 1=has focus, 0=no focus
tags <occ> <sel> <urg>: bitmasks (decimal)tags <occ> <sel> <urg>: bitmasks (9-bit binary)
-l Layout Information
Get current layout symbol.
-c Client Information
Get focused client’s title and application ID.
-v Statusbar Visibility
Get statusbar visibility toggle events.
-m Fullscreen Status
Check if focused client is fullscreen.
-f Floating Status
Check if focused client is floating.
-x Client Geometry
Get focused client’s position and dimensions.
-e Last Layer
Get name of the last focused layer.
-k Keyboard Layout
Get current keyboard layout.
-b Keybind Mode
Get current keybind mode.
-A Scale Factor
Get output scale factor.
Set Options
-t <tagspec> Set Tags
Switch active tags using tag specification.
Numeric Format
Switch to a single tag:Modifier Format
Toggle tags using modifiers+, -, ^:
- Position 1 → Tag 1
- Position 2 → Tag 2
- etc.
+: Enable tag-: Disable tag^: Toggle tag
Implementation from mmsg.c
-l <layout> Set Layout
Change the layout by name.
-c <tagspec> Set Client Tags
Move focused client to different tags.
-t, but affects client tags instead of view tags.
Implementation from mmsg.c
-d <cmd>,<arg1>,<arg2>,... Dispatch Command
Execute internal compositor commands. Supports up to 5 arguments.
Implementation from mmsg.c
Examples
Status Bar Integration
Watch tags and layout for a status bar:Tag Switching Script
Multi-Monitor Control
Client Information Logger
Exit Status
0: Success1: Runtime error2: Usage error (invalid options)
Notes
- Commands in set mode exit immediately after applying changes
- Watch mode runs until interrupted (Ctrl+C) or the compositor quits
- Tag numbers are 1-indexed in command-line interface but 0-indexed in protocol
- Binary tag representations use 9 bits (supporting up to 9 tags)
- Output names come from the Wayland output name event
See Also
- IPC Protocol Overview - Protocol architecture and client development
- Configuration - Configure keybindings for mmsg commands
