Skip to content

Battery

Displays system power information such as the battery percentage, and estimated time to empty.

TODO: ADD SCREENSHOT

Configuration

Type: battery

NameTypeDefaultDescription
formatstring{percentage}%Format string to use for the widget button label.
icon_sizeinteger24Size to render icon at.
thresholdsMap<string, float>{}Map of threshold names to apply as classes against the percentage at which to apply them. The nearest value above the current percentage is applied.
JSON
{
"end": [
{
"type": "battery",
"format": "{percentage}%",
"thresholds": {
"warning": 20,
"critical": 5
}
}
]
}
TOML
[[end]]
type = "battery"
format = "{percentage}%"
[[end.thresholds]]
warning = 20
critical = 5
YAML
end:
- type: "battery"
format: "{percentage}%"
thresholds:
warning: 20
critical: 5
Corn
{
end = [
{
type = "battery"
format = "{percentage}%"
thresholds.warning = 20
thresholds.critical = 5
}
]
}

Formatting Tokens

The following tokens can be used in the format config option, and will be replaced with values from the current battery state:

TokenDescription
{percentage}The battery charge percentage.
{state}The current battery (dis)charging state.
{time_remaining}The ETA to battery empty or full.

Styling

SelectorDescription
.batteryBattery widget button.
.battery.<threshold>Battery widget button (dynamic threshold class)
.battery .contentsBattery widget button contents.
.battery .iconBattery widget battery icon.
.battery .labelBattery widget button label.
.popup-batteryBattery popup box.
.popup-battery .detailsLabel inside the popup.

For more information on styling, please see the styling guide.