Skip to content

Battery

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

TODO: ADD SCREENSHOT

Example

{
end = [
{
type = "battery"
format = "{percentage}%"
thresholds.warning = 20
thresholds.critical = 5
}
]
}

Configuration

Type: battery

The format string to use for the widget button label. For available tokens, see below.

Type: string
Default: {percentage}%

The size to render the icon at, in pixels.

Type: integer
Default: 24

The justification (alignment) of the widget text shown on the bar.

Type: 'left' | 'right' | 'center' | 'fill'
Default: 'left'

The orientation to display the widget contents. Setting to vertical will rotate text 90 degrees.

Type: 'horizontal' | 'vertical'
Default: 'horizontal'

Whether to show the icon.

Type: boolean
Default: true

Whether to show the label.

Type: boolean
Default: true

A map of threshold names to apply as classes, against the battery percentage at which to apply them.

Thresholds work by applying the nearest value above the current percentage, if present.

For example, using the below config: At battery levels below 20%, the .warning class will be applied to the top-level widget. Below 5%, .critical will be applied instead. Above 20%, no class applies.

Type: object
Default: {}

{
end = [
{
type = "battery"
format = "{percentage}%"
thresholds.warning = 20
thresholds.critical = 5
}
]
}

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.