1yambar-modules-battery(5) File Formats Manual yambar-modules-battery(5)
2
3
4
6 battery - This module reads battery status
7
9 This module reads battery status from /sys/class/power_supply and uses
10 udev to monitor for changes.
11
12 Note that it is common (and "normal") for batteries to be in the state
13 unknown under certain conditions.
14
15 For example, some have been seen to enter the unknown state when charg‐
16 ing and the capacity reaches ~90%. The battery then stays in unknown,
17 rather than charging, until it has been fully charged and enters the
18 state full.
19
20 This does not happen with all batteries, and other batteries may enter
21 the state unknown under other conditions.
22
24 ┌─────────────┬────────┬───────────────────────────────────────────────┐
25 │Name │ Type │ Description │
26 ├─────────────┼────────┼───────────────────────────────────────────────┤
27 │name │ string │ Battery device name │
28 ├─────────────┼────────┼───────────────────────────────────────────────┤
29 │manufacturer │ string │ Name of the battery manufacturer │
30 ├─────────────┼────────┼───────────────────────────────────────────────┤
31 │model │ string │ Battery model name │
32 ├─────────────┼────────┼───────────────────────────────────────────────┤
33 │state │ string │ One of full, not charging, charging, dis‐ │
34 │ │ │ charging or unknown │
35 ├─────────────┼────────┼───────────────────────────────────────────────┤
36 │capacity │ range │ capacity left, in percent │
37 ├─────────────┼────────┼───────────────────────────────────────────────┤
38 │estimate │ string │ Estimated time left (to empty while discharg‐ │
39 │ │ │ ing, or to full while charging), formatted as │
40 │ │ │ HH:MM. │
41 └─────────────┴────────┴───────────────────────────────────────────────┘
42
44 ┌──────────────┬────────┬─────┬────────────────────────────────────────┐
45 │Name │ Type │ Req │ Description │
46 ├──────────────┼────────┼─────┼────────────────────────────────────────┤
47 │name │ string │ yes │ Battery device name (one of the names │
48 │ │ │ │ in /sys/class/power_supply) │
49 ├──────────────┼────────┼─────┼────────────────────────────────────────┤
50 │poll-interval │ int │ no │ How often, in milliseconds, to poll │
51 │ │ │ │ for capacity changes (default=60000). │
52 │ │ │ │ Set to `0` to disable polling (warn‐ │
53 │ │ │ │ ing: many batteries do not support │
54 │ │ │ │ asynchronous reporting). Cannot be │
55 │ │ │ │ less than 250ms. │
56 └──────────────┴────────┴─────┴────────────────────────────────────────┘
57
59 bar:
60 left:
61 - battery:
62 name: BAT0
63 poll-interval: 30000
64 content:
65 string: {text: "BAT: {capacity}% {estimate}"}
66
68 yambar-modules(5), yambar-particles(5), yambar-tags(5), yambar-decora‐
69 tions(5)
70
71 2023-07-22 yambar-modules-battery(5)