2019-08-26 23:49:04 +02:00
|
|
|
waybar-states(5)
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2019-09-02 18:33:31 +02:00
|
|
|
- Every entry (*state*) consists of a *<name>* (typeof: *string*) and a *<value>* (typeof: *integer*).
|
2019-08-26 23:49:04 +02:00
|
|
|
|
|
|
|
- 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*.
|
2020-12-12 23:21:17 +01:00
|
|
|
Those can be configured via *format-<name>*.
|
2019-08-26 23:49:04 +02:00
|
|
|
Or if you want to differentiate a bit more even as *format-<status>-<state>*.
|
|
|
|
|
|
|
|
# EXAMPLE
|
|
|
|
|
|
|
|
```
|
|
|
|
"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 the *config*.
|
|
|
|
|
|
|
|
# EXAMPLE:
|
|
|
|
|
|
|
|
- *#battery.warning: { background: orange; }*
|
|
|
|
- *#battery.critical: { background: red; }*
|