Skip to content
Dan edited this page May 3, 2019 · 8 revisions

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) consits of a <name> (typeof: string) and a <value> (typeof: integer).
    • The state can be adressed 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 differntiate a bit more even as format-<status>-<state>. For more information see custom formats.

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. For more information see states

Example:

  • #battery.warning: { background: orange; }
  • #battery.critical: { background: red; }
Clone this wiki locally