Battery
Displays system power information such as the battery percentage, and estimated time to empty.
TODO: ADD SCREENSHOT
Configuration
Type:
battery
| Name | Type | Default | Description |
|---|---|---|---|
format | string | {percentage}% | Format string to use for the widget button label. |
icon_size | integer | 24 | Size to render icon at. |
thresholds | Map<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 = 20critical = 5YAML
end: - type: "battery" format: "{percentage}%" thresholds: warning: 20 critical: 5Corn
{ end = [ { type = "battery" format = "{percentage}%" thresholds.warning = 20 thresholds.critical = 5 } ]}{ "end": [ { "type": "battery", "format": "{percentage}%", "thresholds": { "warning": 20, "critical": 5 } } ]}end: - type: battery format: "{percentage}%" thresholds: warning: 20 critical: 5[[end]]type = "battery"format = "{percentage}%"
[end.thresholds] warning = 20 critical = 5Formatting Tokens
The following tokens can be used in the format config option,
and will be replaced with values from the current battery state:
| Token | Description |
|---|---|
{percentage} | The battery charge percentage. |
{state} | The current battery (dis)charging state. |
{time_remaining} | The ETA to battery empty or full. |
Styling
| Selector | Description |
|---|---|
.battery | Battery widget button. |
.battery.<threshold> | Battery widget button (dynamic threshold class) |
.battery .contents | Battery widget button contents. |
.battery .icon | Battery widget battery icon. |
.battery .label | Battery widget button label. |
.popup-battery | Battery popup box. |
.popup-battery .details | Label inside the popup. |
For more information on styling, please see the styling guide.