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 interval:
30 typeof: integer
31 default: 60
32 The interval in which the information gets polled.
33
34 states:
35 typeof: array
36 A number of battery states which get activated on certain capacity
37 levels. See waybar-states(5).
38
39 format:
40 typeof: string
41 default: {capacity}%
42 The format, how the time should be displayed.
43
44 format-time:
45 typeof: string
46 default: {H} h {M} min
47 The format, how the time should be displayed.
48
49 format-icons:
50 typeof: array/object
51 Based on the current capacity, the corresponding icon gets
52 selected.
53 The order is low to high. Or by the state if it is an object.
54
55 max-length:
56 typeof: integer
57 The maximum length in character the module should display.
58
59 rotate:
60 typeof: integer
61 Positive value to rotate the text label.
62
63 on-click:
64 typeof: string
65 Command to execute when clicked on the module.
66
67 on-click-middle:
68 typeof: string
69 Command to execute when middle-clicked on the module using mouse‐
70 wheel.
71
72 on-click-right:
73 typeof: string
74 Command to execute when you right clicked on the module.
75
76 on-update:
77 typeof: string
78 Command to execute when the module is updated.
79
80 on-scroll-up:
81 typeof: string
82 Command to execute when scrolling up on the module.
83
84 on-scroll-down:
85 typeof: string
86 Command to execute when scrolling down on the module.
87
88 smooth-scrolling-threshold:
89 typeof: double
90 Threshold to be used when scrolling.
91
92 tooltip:
93 typeof: bool
94 default: true
95 Option to disable tooltip on hover.
96
98 {capacity}: Capacity in percentage
99
100 {icon}: Icon, as defined in format-icons.
101
102 {time}: Estimate of time until full or empty. Note that this is based
103 on the power draw at the last refresh time, not an average.
104
106 The battery module allows you to define how time should be formatted
107 via format-time.
108
109 The two arguments are: {H}: Hours {M}: Minutes
110
112 The battery module allows to define custom formats based on up to two
113 factors. The best fitting format will be selected.
114
115 format-<state>: With states, a custom format can be set depending on
116 the capacity of your battery.
117
118 format-<status>: With the status, a custom format can be set depending
119 on the status in /sys/class/power_supply/<bat>/status (in lowercase).
120
121 format-<status>-<state>: You can also set a custom format depending on
122 both values.
123
125 · Every entry (state) consists of a <name> (typeof: string) and a
126 <value> (typeof: integer).
127 · The state can be addressed as a CSS class in the style.css. The
128 name of the CSS class is the <name> of the state. Each class
129 gets activated when the current capacity is equal or below the
130 configured <value>.
131 · Also each state can have its own format. Those con be config‐
132 ured via format-<name>. Or if you want to differentiate a bit
133 more even as format-<status>-<state>. For more information see
134 custom-formats.
135
136
138 "battery": {
139 "bat": "BAT2",
140 "interval": 60,
141 "states": {
142 "warning": 30,
143 "critical": 15
144 },
145 "format": "{capacity}% {icon}",
146 "format-icons": ["", "", "", "", ""],
147 "max-length": 25
148 }
149
151 · #battery
152 · #battery.<status>
153 · <status> is the value of /sys/class/power_supply/<bat>/status
154 in lowercase.
155 · #battery.<state>
156 · <state> can be defined in the config. For more information see
157 states.
158 · #battery.<status>.<state>
159 · Combination of both <status> and <state>.
160
161
162
163 2021-02-10 waybar-battery(5)