1yambar-modules-battery(5)     File Formats Manual    yambar-modules-battery(5)
2
3
4

NAME

6       battery - This module reads battery status
7

DESCRIPTION

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

TAGS

24       ┌─────────────┬────────┬─────────────────────┐
25Name         Type   Description         
26       ├─────────────┼────────┼─────────────────────┤
27       │name         │ string │ Battery device name │
28       ├─────────────┼────────┼─────────────────────┤
29       │manufacturer │ string │ Name of the battery │
30       │             │        │ manufacturer        │
31       ├─────────────┼────────┼─────────────────────┤
32       │model        │ string │ Battery model name  │
33       ├─────────────┼────────┼─────────────────────┤
34       │state        │ string │ One of full, not    
35       │             │        │ charging, charging, │
36       │             │        │ discharging or un‐  
37       │             │        │ known               
38       ├─────────────┼────────┼─────────────────────┤
39       │capacity     │ range  │ capacity left, in   │
40       │             │        │ percent             │
41       ├─────────────┼────────┼─────────────────────┤
42       │estimate     │ string │ Estimated time left │
43       │             │        │ (to empty while     │
44       │             │        │ discharging, or to  │
45       │             │        │ full while charg‐   │
46       │             │        │ ing), formatted as  │
47       │             │        │ HH:MM.              │
48       └─────────────┴────────┴─────────────────────┘
49

CONFIGURATION

51       ┌──────────────┬────────┬─────┬───────────────────────┐
52Name          Type   Req Description           
53       ├──────────────┼────────┼─────┼───────────────────────┤
54       │name          │ string │ yes │ Battery device        │
55       │              │        │     │ name (one of the      │
56       │              │        │     │ names in              │
57       │              │        │     │ /sys/class/power_sup‐ 
58       │              │        │     │ ply)                  │
59       ├──────────────┼────────┼─────┼───────────────────────┤
60       │poll-interval │ int    │ no  │ How often, in sec‐    │
61       │              │        │     │ onds, to poll for ca‐ │
62       │              │        │     │ pacity changes (de‐   │
63       │              │        │     │ fault=60). Set to `0` │
64       │              │        │     │ to disable polling    │
65       │              │        │     │ (warning: many bat‐   │
66       │              │        │     │ teries do not support │
67       │              │        │     │ asynchronous report‐  │
68       │              │        │     │ ing).                 │
69       └──────────────┴────────┴─────┴───────────────────────┘
70

EXAMPLES

72           bar:
73             left:
74               - battery:
75                   name: BAT0
76                   poll-interval: 30
77                   content:
78                     string: {text: "BAT: {capacity}% {estimate}"}
79

SEE ALSO

81       yambar-modules(5), yambar-particles(5), yambar-tags(5), yambar-decora‐
82       tions(5)
83
84                                  2022-08-26         yambar-modules-battery(5)
Impressum