2019-08-24 17:44:29 +01:00
waybar-battery(5)
# NAME
waybar - battery module
# DESCRIPTION
The * battery * module displays the current capacity and state (eg. charging) of your battery.
2019-08-24 21:46:56 +01:00
# CONFIGURATION
2019-08-24 17:44:29 +01:00
* bat * ++
typeof: string ++
The battery to monitor, as in /sys/class/power_supply/ instead of auto detect.
* adapter * ++
typeof: string ++
The adapter to monitor, as in /sys/class/power_supply/ instead of auto detect.
2020-04-05 16:56:51 +02:00
* full-at * ++
typeof: integer ++
Define the max percentage of the battery, usefull for an old battery, e.g. 96
2019-08-24 17:44:29 +01:00
* interval * ++
typeof: integer ++
default: 60 ++
The interval in which the information gets polled.
* states * ++
typeof: array ++
A number of battery states which get activated on certain capacity levels. See *waybar-states(5)*.
* format * ++
typeof: string ++
default: {capacity}% ++
The format, how the time should be displayed.
2019-09-06 14:53:43 -04:00
* format-time * ++
typeof: string ++
default: {H} h {M} min ++
The format, how the time should be displayed.
2020-01-04 04:31:24 +01:00
* format-icons * : ++
typeof: array/object ++
2019-08-24 17:44:29 +01:00
Based on the current capacity, the corresponding icon gets selected. ++
The order is *low* to *high*. Or by the state if it is an object.
2020-01-04 04:31:24 +01:00
* max-length * : ++
2019-08-24 17:44:29 +01:00
typeof: integer++
The maximum length in character the module should display.
2020-01-04 04:31:24 +01:00
* rotate * : ++
2019-08-24 17:44:29 +01:00
typeof: integer++
Positive value to rotate the text label.
2020-01-04 04:31:24 +01:00
* on-click * : ++
2019-08-24 17:44:29 +01:00
typeof: string ++
Command to execute when clicked on the module.
2019-12-28 20:19:45 -08:00
* on-click-middle * : ++
typeof: string ++
Command to execute when middle-clicked on the module using mousewheel.
* on-click-right * ++
2019-08-24 17:44:29 +01:00
typeof: string ++
Command to execute when you right clicked on the module.
2020-01-04 04:31:24 +01:00
* on-scroll-up * : ++
2019-08-24 17:44:29 +01:00
typeof: string ++
Command to execute when scrolling up on the module.
2020-01-04 04:31:24 +01:00
* on-scroll-down * : ++
2019-08-24 17:44:29 +01:00
typeof: string ++
Command to execute when scrolling down on the module.
* smooth-scrolling-threshold * ++
typeof: double ++
Threshold to be used when scrolling.
* tooltip * ++
typeof: bool ++
default: true ++
Option to disable tooltip on hover.
2019-08-24 21:46:56 +01:00
# FORMAT REPLACEMENTS
2019-08-24 17:44:29 +01:00
* {capacity} * : Capacity in percentage
* {icon} * : Icon, as defined in * format-icons * .
* {time} * : Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average.
2019-09-06 14:53:43 -04:00
# TIME FORMAT
The * battery * module allows you to define how time should be formatted via * format-time * .
The two arguments are:
* {H} * : Hours
* {M} * : Minutes
2019-08-24 21:46:56 +01:00
# CUSTOM FORMATS
2019-08-24 17:44:29 +01:00
The * battery * module allows to define custom formats based on up to two factors. The best fitting format will be selected.
* format-<state> * : With * states * , a custom format can be set depending on the capacity of your battery.
* format-<status> * : With the status, a custom format can be set depending on the status in /sys/class/power_supply/<bat>/status (in lowercase).
* format-<status>-<state> * : You can also set a custom format depending on both values.
2019-08-24 21:46:56 +01:00
# STATES
2019-08-24 17:44:29 +01:00
- Every entry (* state * ) consists of a * <name> * (typeof: * string * ) and a * <value> * (typeof: * integer * ).
- The state can be addressed as a CSS class in the * style.css * . The name of the CSS class is the * <name> * of the state. Each class gets activated when the current capacity is equal or below the configured * <value> * .
- Also each state can have its own * format * . Those con be configured via * format-<name> * . Or if you want to differentiate a bit more even as * format-<status>-<state> * . For more information see * custom-formats * .
2019-08-26 22:28:24 +01:00
# EXAMPLES
2019-08-24 17:44:29 +01:00
```
"battery": {
"bat": "BAT2",
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""],
"max-length": 25
}
```
2019-08-24 21:46:56 +01:00
# STYLE
2019-08-24 17:44:29 +01:00
- * #battery *
- * #battery.<status> *
- * <status> * is the value of /sys/class/power_supply/<bat>/status in lowercase.
- * #battery.<state> *
- * <state> * can be defined in the * config * . For more information see * states * .
- * #battery.<status>.<state> *
- Combination of both * <status> * and * <state> * .