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 } ]}{ "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 = 5Configuration
Type:
battery
format
Section titled “format”The format string to use for the widget button label. For available tokens, see below.
Type: string
Default: {percentage}%
icon_size
Section titled “icon_size”The size to render the icon at, in pixels.
Type: integer
Default: 24
justify
Section titled “justify”The justification (alignment) of the widget text shown on the bar.
Type: 'left' | 'right' | 'center' | 'fill'
Default: 'left'
orientation
Section titled “orientation”The orientation to display the widget contents. Setting to vertical will rotate text 90 degrees.
Type: 'horizontal' | 'vertical'
Default: 'horizontal'
show_icon
Section titled “show_icon”Whether to show the icon.
Type: boolean
Default: true
show_label
Section titled “show_label”Whether to show the label.
Type: boolean
Default: true
thresholds
Section titled “thresholds”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: {}
Example
Section titled “Example”{ 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 = 5Styling
| 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.