Skip to Content
mangobar

Battery

Options and usage for the Battery module in mangobar.

Shows charge percent and status. By default the first battery found is used; on multi-battery laptops each battery can be shown separately with battery#BAT0, battery#BAT1, ... — each instance is configured and styled independently, and a battery that is unplugged simply hides its module.

"modules-right": ["battery#BAT0", "battery#BAT1"],

"battery#BAT0": {
    "format": "{icon} {percent}%",
    "hide-on-ac": true
},
"battery#BAT1": {
    "format": "{icon} {percent}%",
    "hide-on-ac": true
}

Options

OptionTypeDefaultDescription
formatstring{icon} {percent}% {status}Display format (see placeholders)
iconsstring arraybuilt-in 11 levelsIcons shown by charge level while discharging
icon-chargingstring—Icon used while charging
icon-fullstring—Icon used when full
icon-acstring—Plug icon shown when on AC
hide-on-acboolfalseHide the module entirely while plugged in
devicestringfirst batterysysfs battery device (plain battery module only)

Placeholders

PlaceholderDescription
{} / {percent}Charge percent
{icon}Icon by state / level
{status}Status string (Charging / Full / Discharging / ...)
{ac}AC plug icon when plugged in

Styling

#battery {
  background: linear-gradient(to top, #b8bb26, mix(#b8bb26, #fbf1c7, 0.3));
  color: #1b1a1a;
}

Last updated on

On this page