battery battery status pill

veiland-battery · widgets · example scene: battery_svg.toml

Battery status drawn from bucketed SVG icons in a small pill, with an optional percent + charging-state label. Reads /sys/class/power_supply. The template for the status-icon pattern.

battery scene capture

The glyph is chosen from bucketed SVG icons by charge level and charging state, read from /sys/class/power_supply. A machine with no battery shows the "AC" glyph. This widget is also the copy-me starting point for writing your own status-icon pill.

See the widgets overview for the shared pill_color / icon_color, anchor, font, and debug_border keys.

Properties

keytypedefaultmeaning
pill_color[r,g,b,a]`[0.059, 0.071, 0.11, 0.686]`Chip background behind the glyph. `[0, 0, 0, 0]` draws no chip.
icon_color[r,g,b,a]whiteTints the glyph. Omit for white.
show_labelbool`false`Show the percent + state text (e.g. `64% Discharging`, or `AC` on a desktop with no battery). Off = icon-only pill.
label_color[r,g,b,a]`[0.95, 0.95, 0.95, 1.0]`Label text color (RGB only; alpha does not hide it).
label_posstring`"bottom"`Label position relative to the glyph: `top`, `bottom`, `left`, or `right`.

every key is optional; omit it and the default applies. misspelled keys are silently ignored, so if a setting seems to do nothing, check the spelling against this table. colors are 0.0–1.0 float arrays.