1waybar-battery(5) File Formats Manual waybar-battery(5)
2
3
4
6 waybar - battery module
7
9 The battery module displays the current capacity and state (eg. charg‐
10 ing) of your battery.
11
13 bat:
14 typeof: string
15 The battery to monitor, as in /sys/class/power_supply/ instead of
16 auto detect.
17
18 adapter:
19 typeof: string
20 The adapter to monitor, as in /sys/class/power_supply/ instead of
21 auto detect.
22
23 full-at:
24 typeof: integer
25 Define the max percentage of the battery, for when you've set the
26 battery to stop charging at a lower level to save it. For example, if
27 you've set the battery to stop at 80% that will become the new 100%.
28
29 design-capacity:
30 typeof: bool
31 default: false
32 Option to use the battery design capacity instead of it's current
33 maximal capacity.
34
35 interval:
36 typeof: integer
37 default: 60
38 The interval in which the information gets polled.
39
40 states:
41 typeof: array
42 A number of battery states which get activated on certain capacity
43 levels. See waybar-states(5).
44
45 format:
46 typeof: string
47 default: {capacity}%
48 The format, how the time should be displayed.
49
50 format-time:
51 typeof: string
52 default: {H} h {M} min
53 The format, how the time should be displayed.
54
55 format-icons:
56 typeof: array/object
57 Based on the current capacity, the corresponding icon gets se‐
58 lected.
59 The order is low to high. Or by the state if it is an object.
60
61 max-length:
62 typeof: integer
63 The maximum length in character the module should display.
64
65 min-length:
66 typeof: integer
67 The minimum length in characters the module should take up.
68
69 align:
70 typeof: float
71 The alignment of the text, where 0 is left-aligned and 1 is right-
72 aligned. If the module is rotated, it will follow the flow of the text.
73
74 rotate:
75 typeof: integer
76 Positive value to rotate the text label.
77
78 on-click:
79 typeof: string
80 Command to execute when clicked on the module.
81
82 on-click-middle:
83 typeof: string
84 Command to execute when middle-clicked on the module using mouse‐
85 wheel.
86
87 on-click-right:
88 typeof: string
89 Command to execute when you right clicked on the module.
90
91 on-update:
92 typeof: string
93 Command to execute when the module is updated.
94
95 on-scroll-up:
96 typeof: string
97 Command to execute when scrolling up on the module.
98
99 on-scroll-down:
100 typeof: string
101 Command to execute when scrolling down on the module.
102
103 smooth-scrolling-threshold:
104 typeof: double
105 Threshold to be used when scrolling.
106
107 tooltip:
108 typeof: bool
109 default: true
110 Option to disable tooltip on hover.
111
113 {capacity}: Capacity in percentage
114
115 {power}: Power in watts
116
117 {icon}: Icon, as defined in format-icons.
118
119 {time}: Estimate of time until full or empty. Note that this is based
120 on the power draw at the last refresh time, not an average.
121
123 The battery module allows you to define how time should be formatted
124 via format-time.
125
126 The two arguments are: {H}: Hours {M}: Minutes
127
129 The battery module allows to define custom formats based on up to two
130 factors. The best fitting format will be selected.
131
132 format-<state>: With states, a custom format can be set depending on
133 the capacity of your battery.
134
135 format-<status>: With the status, a custom format can be set depending
136 on the status in /sys/class/power_supply/<bat>/status (in lowercase).
137
138 format-<status>-<state>: You can also set a custom format depending on
139 both values.
140
142 • Every entry (state) consists of a <name> (typeof: string) and a
143 <value> (typeof: integer).
144 • The state can be addressed as a CSS class in the style.css. The
145 name of the CSS class is the <name> of the state. Each class
146 gets activated when the current capacity is equal or below the
147 configured <value>.
148 • Also each state can have its own format. Those con be config‐
149 ured via format-<name>. Or if you want to differentiate a bit
150 more even as format-<status>-<state>. For more information see
151 custom-formats.
152
153
155 "battery": {
156 "bat": "BAT2",
157 "interval": 60,
158 "states": {
159 "warning": 30,
160 "critical": 15
161 },
162 "format": "{capacity}% {icon}",
163 "format-icons": ["", "", "", "", ""],
164 "max-length": 25
165 }
166
168 • #battery
169 • #battery.<status>
170 • <status> is the value of /sys/class/power_supply/<bat>/status
171 in lowercase.
172 • #battery.<state>
173 • <state> can be defined in the config. For more information see
174 states.
175 • #battery.<status>.<state>
176 • Combination of both <status> and <state>.
177
178
179
180 2021-04-15 waybar-battery(5)