Repository navigation
Multi Monitor Configuration
mangobar can run a different bar on each output (monitor). Instead of a
single global configuration you may supply profiles, each optionally
bound to one or more Wayland output names (for example DP-1,
HDMI-A-1 or eDP-1). Every profile is a full bar configuration, so
layout, height, module formats and actions can differ per monitor.
The top level of config.jsonc must be one of:
-
A single object — the classic configuration, used for every output (no profile selection needed):
-
A root array of profile objects — the recommended way to configure multiple monitors:
[ { "output": ["DP-1", "DP-2"], "height": 30, "modules-left": ["workspaces", "layout"], "modules-right": ["cpu", "memory", "clock#time"] }, { // no "output" → fallback for any other monitor "height": 24, "modules-right": ["battery", "clock#time"] } ]
Each profile may carry an output selector:
output value |
Meaning |
|---|---|
string, e.g. "DP-1"
|
Apply this profile to that output only |
array of strings, e.g. ["DP-1", "DP-2"]
|
Apply to each listed output |
| omitted | Fallback: apply to every output not matched by another profile |
Matching rules:
- Output names come from the compositor's xdg-output
nameevent (usually the connector name). - A profile without
outputis the fallback; at most one fallback is allowed. - The same output name must not appear in more than one profile.
- If no profile matches an output and there is no fallback, mangobar simply shows no bar on that output.
- A single-object config that contains
"output"behaves the same way: it applies to the listed outputs only, and other outputs get no bar. Omitoutputfrom a single object to keep the old "one bar everywhere" behavior.
[
{
"output": "DP-1",
"height": 32,
"modules-left": ["workspaces", "layout"],
"modules-right": ["clock#time"]
},
{
// fallback: secondary/laptop displays
"height": 24,
"modules-left": ["workspaces"],
"modules-right": ["battery", "clock#time"]
}
][
{
"output": "HDMI-A-1",
"height": 22,
"modules-left": ["workspaces"],
"modules-right": ["clock#time"]
},
{
"height": 30,
"modules-left": ["workspaces", "layout", "window"],
"modules-center": [],
"modules-right": ["network", "pulseaudio", "battery", "clock#time"]
}
][
{
"output": ["DP-1", "DP-2"],
"height": 30,
"modules-right": ["cpu", "memory", "clock#time"]
}
]Outputs other than DP-1 and DP-2 get no bar here, because there is no
fallback profile.
Every profile is parsed independently and can set:
-
height,layer,buffer-scale -
modules-left,modules-center,modules-right - module sections and their formats, alternates, actions and scroll settings
- custom module commands, signals and intervals
-
workspacesoptions such ashide-empty,pinnedandtag-names
What stays shared:
- The CSS stylesheet (and the font) is shared by all profiles. When the top
level is an array of profiles the
css/stylekeys are rejected; put the stylesheet at the default location (~/.config/mangobar/style.css) or set$MANGOBAR_CSS. A single-object configuration may still setcss/styleinline. - PulseAudio and backlight state is system-wide; profile-level
formatsettings still apply per bar.
services.mangobar.settings accepts a single attribute set or a list of
attribute sets. A list is written as a JSON root array, one entry per
output profile:
services.mangobar = {
enable = true;
settings = [
{
output = [ "DP-1" ];
height = 30;
modules-right = [ "cpu" "memory" "clock#time" ];
}
{
height = 24;
modules-right = [ "battery" "clock#time" ];
}
];
};An empty list is rejected.
See Configuration for the full list of options available inside each profile.
{ "layer": "top", "height": 30, "modules-left": ["workspaces", "layout"], "modules-right": ["cpu", "memory", "clock#time"] }