waybar-states(5)
π waybar-states(5) β the states property, bestie edition π
okay so real quick: this is the manual page for waybar-states, aka the states property in waybar. it's short, it's sweet, it's lowkey iconic, and by the end you're gonna be styling your bar like a main character. let's go π¦
β¨ NAME β¨
waybar β the states property πΈ
π OVERVIEW π
so, some modules support what we call states. what that does is let you use percentage values as styling triggers β like, when the value matches the declared state value, boom, a class gets applied. it's giving "your battery is dying so let's make it orange" energy π
π STATES π
every entry (aka every state) is made of exactly two little friends:
- a
<name>β typeof:stringπ - a
<value>β typeof:integerβ¨
and here's the tea about how they work:
- the state can be addressed as a CSS class in the
style.css. the name of that CSS class is the<name>of the state. now, when does each class wake up and activate? listen closely bestie, this part is important:- for the battery module: the class activates when the current value is equal to or less than the configured
<value>. - for all other modules: the class activates when the current value is equal to or greater than the configured
<value>.
- for the battery module: the class activates when the current value is equal to or less than the configured
- ALSO (and this is the fun part π), each state can have its own format. you configure those with
format-<name>β or, if you wanna differentiate a bit more, you go withformat-<status>-<state>. obsessed. π
π EXAMPLE π
here's what it looks like in the config, no cap:
"battery": {
"bat": "BAT2",
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""],
"max-length": 25
}
likeβ¦ look at those states. warning at 30, critical at 15. she's organized, she's prepared, she ate π
π STYLING STATES π
#battery.<state>β where<state>can be defined in the config π
πΈ EXAMPLE πΈ
#battery.warning: { background: orange; }π#battery.critical: { background: red; }π₯
see how the <state> you named in your config just slides right into the CSS selector? that's the whole vibe. slay. π
quick vibe check: battery module goes equal to or less than<value>, every other module goes equal to or greater than<value>. don't mix those up bestie, it's literally the one thing that trips people up π
aaaand that's the whole page!! this was waybar-states(5) from the File Formats Manual, dated 2026-02-08 β mwah, go make your bar pretty, ily, bye π«Άπβ¨
π¦ where this page comes from
- ubuntu resolute: waybar 0.15.0-1 Β· MIT
- ubuntu stonking: waybar 0.15.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms