Skip to content

Battery

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

TODO: ADD SCREENSHOT

Configuration

Type: battery

NameTypeDefaultProfile?Description
formatstring{percentage}%YesFormat string to use for the widget button label.
icon_sizeinteger24NoSize to render icon at.
show_iconbooleantrueNoWhether to show the icon.
show_labelbooleantrueNoWhether to show the label.
use_default_profilesbooleantrueNoWhether default profiles should be used.

This module uses a compound threshold with 1-2 values for profiles:

  • percent - 0-100
  • charging - true/false (optional)

Information on the profiles system can be found here.

JSON
{
"end": [
{
"type": "battery",
"format": "{percentage}%",
"profiles": {
"warning": 20,
"critical": {
"when": { "percent": 5, "charging": false },
"format": "[LOW] {percentage}%"
}
}
}
]
}
TOML
[[end]]
type = "battery"
format = "{percentage}%"
[end.profiles]
warning = 20
[end.profiles.critical]
when = { percent = 5, charging = false }
format = "[LOW] {percentage}%"
YAML
end:
- type: "battery"
format: "{percentage}%"
profiles:
warning: 20
critical:
when:
percent: 5
charging: false
format: "[LOW] {percentage}%"
Corn
{
end = [
{
type = "battery"
format = "{percentage}%"
profiles.warning = 20
profiles.critical.when = { percent = 5 charging = false }
profiles.critical.format = "[LOW] {percentage}%"
}
]
}

Default profiles

This module does not include any default profiles.

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.