mmsg is the IPC (Inter-Process Communication) tool for Mango Wayland Compositor. It allows you to query and control the compositor’s state from external scripts and programs.
Overview
mmsg communicates with Mango through the Wayland protocol using the zdwl_ipc_manager_v2 interface. It supports three operation modes:
- Get mode (
-g): Query current state - Set mode (
-s): Modify compositor state - Watch mode (
-w): Stream live events
Installation
mmsg is built and installed automatically when you compile Mango:
/usr/bin/mmsg.
Usage Syntax
Operation Modes
Get Mode (-g)
Query the current state of the compositor:
Set Mode (-s)
Modify the compositor state:
Watch Mode (-w)
Stream live events from the compositor:
Get Options
These flags retrieve specific information:| Flag | Description |
|---|---|
-O | Output (monitor) name |
-o | Monitor focus information |
-t | Selected tags and tag state |
-l | Current layout |
-c | Focused client title and app ID |
-v | Status bar visibility |
-m | Fullscreen status |
-f | Floating status |
-x | Focused client geometry (x, y, width, height) |
-e | Name of last focused layer |
-k | Current keyboard layout |
-b | Current keybind mode |
-A | Monitor scale factor |
-T | Number of tags |
-L | All available layouts |
Set Options
These flags modify compositor state:Tag Manipulation
The-t flag accepts tag numbers with optional modifiers:
Client Tag Assignment
The-c flag moves the focused window to tags:
Dispatch Commands
The-d flag executes internal compositor commands:
Output Selection
Use-o to target a specific monitor:
mmsg operates on the currently focused monitor.
Tag State Output
When querying tags with-g -t, mmsg outputs detailed information:
0= inactive1= active (tag is visible)2= urgent (window needs attention)
- occupied (occ): Bitmask of tags with windows
- selected (seltags): Bitmask of currently visible tags
- urgent (urg): Bitmask of tags with urgent windows
Practical Examples
Status Bar Integration
Window Title Monitor
Tag Switcher Script
Layout Cycle
Source Code Reference
Themmsg implementation can be found in /home/daytona/workspace/source/mmsg/mmsg.c.
Key functions:
dwl_ipc_output_tag()- Processes tag state updates (mmsg.c:142)dwl_ipc_output_frame()- Handles state changes and dispatches commands (mmsg.c:313)bin_str_9bits()- Converts tag masks to binary strings (mmsg.c:89)
Troubleshooting
mmsg returns 'bad display'
mmsg returns 'bad display'
This error means
mmsg cannot connect to the Wayland display.Solutions:- Ensure
WAYLAND_DISPLAYenvironment variable is set - Check that Mango is running
- Verify you’re in the same session as Mango
mmsg returns 'bad dwl-ipc protocol'
mmsg returns 'bad dwl-ipc protocol'
Mango’s IPC protocol is not available.Causes:
- Mango was built without IPC support
- Using an incompatible version of mmsg with Mango
Tag changes don't work as expected
Tag changes don't work as expected
Double-check your tag number and modifier syntax:
Dispatch commands fail silently
Dispatch commands fail silently
Ensure command names match exactly with config.conf bindings:
See Also
- Custom Scripts - Examples using mmsg
- Configuration Reference - Available commands for dispatch
- Troubleshooting - General Mango issues
