Skip to content

Multi Monitor Configuration

DreamMaoMao edited this page Sep 4, 2026 · 1 revision

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.

Accepted configuration shapes

The top level of config.jsonc must be one of:

  1. A single object — the classic configuration, used for every output (no profile selection needed):

    {
        "layer": "top",
        "height": 30,
        "modules-left": ["workspaces", "layout"],
        "modules-right": ["cpu", "memory", "clock#time"]
    }
  2. 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"]
        }
    ]

Profile matching

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 name event (usually the connector name).
  • A profile without output is 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. Omit output from a single object to keep the old "one bar everywhere" behavior.

Examples

Same bar everywhere, different heights

[
    {
        "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"]
    }
]

Minimal bar on one monitor, full bar elsewhere

[
    {
        "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"]
    }
]

Show a bar on selected outputs only

[
    {
        "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.

What is per-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
  • workspaces options such as hide-empty, pinned and tag-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 / style keys are rejected; put the stylesheet at the default location (~/.config/mangobar/style.css) or set $MANGOBAR_CSS. A single-object configuration may still set css / style inline.
  • PulseAudio and backlight state is system-wide; profile-level format settings still apply per bar.

Nix (Home Manager)

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.

Clone this wiki locally