Skip to content

Configuration

DreamMaoMao edited this page Aug 29, 2026 · 2 revisions

Configuration

The configuration is a JSONC file (JSON with // comments and trailing commas allowed). mangobar reads it from $MANGOBAR_CONFIG or ~/.config/mangobar/config.jsonc.

Bar Options

Option Type Default Description
height int 30 Bar height in logical pixels
layer string top Layer: top, overlay or bottom
buffer-scale int 1 HiDPI multiplier on top of the output's Wayland scale; leave 1 to follow the display scale automatically
css / style string Path to the CSS style file (overrides the default location)
scroll-interval int (ms) 0 Debounce window for scroll actions (see below)
smooth-scrolling-threshold float 5.0 Pointer-axis distance that produces one synthetic scroll step
modules-left array Modules anchored to the left edge
modules-center array Modules forced to the true screen center
modules-right array Modules anchored to the right edge

Module placement

Any module can be placed in modules-left, modules-center or modules-right. When modules-center is non-empty, those modules are centered and the left/right groups only take the remaining space on their own side. Without center modules the left group expands toward the right group (the window module absorbs the squeeze).

{
    "modules-left": ["workspaces", "layout", "window"],
    "modules-center": [],
    "modules-right": ["memory", "pulseaudio", "battery", "clock#time"]
}

Common Module Options

Every module accepts the following options:

Option Type Default Description
format string module-specific Display format; see each module page for placeholders
format-alt string Alternate format; a left click toggles between the two
max-length int (px) 0 (unlimited) Maximum rendered text width in pixels; longer text is truncated with ...
scroll-interval int (ms) global value Per-module scroll debounce override
smooth-scrolling-threshold float global value Per-module smooth-scroll threshold override
on-click string Command run on left click
on-click-middle string Command run on middle click
on-click-right string Command run on right click
on-scroll-up string Command run on scroll up
on-scroll-down string Command run on scroll down

See Module actions for the command syntax.

max-length

max-length limits the rendered pixel width of the module text (0 = unlimited). Truncated text gets a ... suffix.

"window": {
    "format": "{}",
    "max-length": 300
}

scroll-interval

Debounces repeated scroll events: scrolls inside the interval keep resetting the timer, so a continuous scroll only triggers once. It can be set at the top level or per module:

"workspaces": {
    "scroll-interval": 100,
    "on-scroll-up": "mmsg dispatch viewtoleft_have_client",
    "on-scroll-down": "mmsg dispatch viewtoright_have_client"
}

smooth-scrolling-threshold

Controls how much continuous pointer-axis motion (e.g. a touchpad two-finger gesture) produces one scroll action. Motion is accumulated independently for horizontal and vertical axes; amounts below the threshold are kept for the next frame. Discrete mouse-wheel steps always use their protocol-provided step count.

"backlight": { "smooth-scrolling-threshold": 5.0 }

format-alt

Any module with a format can define format-alt; a left click toggles between the two formats (the module's on-click command still runs if configured).

"network": {
    "format": "󰈀 {ifname}",
    "format-alt": "↓{down} ↑{up}"
}

Example

See the bundled config.jsonc for a complete example, and Styling for the CSS side.

Module actions

Actions are configured through each module's on-click / on-click-middle / on-click-right / on-scroll-up / on-scroll-down fields.

Command Behavior
@view Switch to a tag over IPC (tags module)
@toggle Toggle a tag over IPC (tags module)
@ipc:xxx Send xxx verbatim over the compositor IPC socket
anything else Run via /bin/sh -c
"layout": {
    "format": "{}"
},
"window": {
    "format": "{}",
    "on-click": "bash ~/.config/mango/scripts/screenshot.sh",
    "on-click-right": "python /home/wrq/tool/ocr.py"
},
"workspaces": {
    "on-click": "activate",
    "on-click-right": "toggle",
    "on-scroll-up": "mmsg dispatch viewtoleft_have_client",
    "on-scroll-down": "mmsg dispatch viewtoright_have_client"
}

@ipc: commands are useful for controlling the compositor directly, e.g.

"tags": {
    "on-click": "activate",
    "on-click-right": "toggle"
}

The special activate / toggle values are translated to the mangowm IPC commands @view and @toggle respectively.

Clone this wiki locally