waybar-states5
States property
Overview
Some modules support 'states' which allows percentage values to be used as styling triggers to apply a class when the value matches the declared state value.
States
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 value is equal to or less than the configured<value>for thebatterymodule, or equal to or greater than the configured<value>for all other modules.
- •
-
Also, each state can have its own
format. Those can be configured viaformat-<name>, or if you want to differentiate a bit more, asformat-<status>-<state>.
Examples
"battery": {
"bat": "BAT2",
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""],
"max-length": 25
}
Styling states
- •
-
#battery.<state>-<state>can be defined in theconfig.
Example:
•
|
#battery.warning: { background: orange; } |
|---|---|
•
|
#battery.critical: { background: red; } |
Releases
4 releases since Debian 11 (Bullseye); the text changed 3 times.