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

NAME

6       waybar - battery module
7

DESCRIPTION

9       The battery module displays the current capacity and state (eg. charg‐
10       ing) of your battery.
11

CONFIGURATION

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, usefull for an old bat‐
26       tery, e.g. 96
27
28       interval
29            typeof: integer
30            default: 60
31            The interval in which the information gets polled.
32
33       states
34            typeof: array
35            A number of battery states which get activated on certain capacity
36       levels. See waybar-states(5).
37
38       format
39            typeof: string
40            default: {capacity}%
41            The format, how the time should be displayed.
42
43       format-time
44            typeof: string
45            default: {H} h {M} min
46            The format, how the time should be displayed.
47
48       format-icons:
49            typeof: array/object
50            Based on the current capacity, the corresponding icon gets
51       selected.
52            The order is low to high. Or by the state if it is an object.
53
54       max-length:
55            typeof: integer
56            The maximum length in character the module should display.
57
58       rotate:
59            typeof: integer
60            Positive value to rotate the text label.
61
62       on-click:
63            typeof: string
64            Command to execute when clicked on the module.
65
66       on-click-middle:
67            typeof: string
68            Command to execute when middle-clicked on the module using mouse‐
69       wheel.
70
71       on-click-right
72            typeof: string
73            Command to execute when you right clicked on the module.
74
75       on-scroll-up:
76            typeof: string
77            Command to execute when scrolling up on the module.
78
79       on-scroll-down:
80            typeof: string
81            Command to execute when scrolling down on the module.
82
83       smooth-scrolling-threshold
84            typeof: double
85            Threshold to be used when scrolling.
86
87       tooltip
88            typeof: bool
89            default: true
90            Option to disable tooltip on hover.
91

FORMAT REPLACEMENTS

93       {capacity}: Capacity in percentage
94
95       {icon}: Icon, as defined in format-icons.
96
97       {time}: Estimate of time until full or empty. Note that this is based
98       on the power draw at the last refresh time, not an average.
99

TIME FORMAT

101       The battery module allows you to define how time should be formatted
102       via format-time.
103
104       The two arguments are: {H}: Hours {M}: Minutes
105

CUSTOM FORMATS

107       The battery module allows to define custom formats based on up to two
108       factors. The best fitting format will be selected.
109
110       format-<state>: With states, a custom format can be set depending on
111       the capacity of your battery.
112
113       format-<status>: With the status, a custom format can be set depending
114       on the status in /sys/class/power_supply/<bat>/status (in lowercase).
115
116       format-<status>-<state>: You can also set a custom format depending on
117       both values.
118

STATES

120       ·   Every entry (state) consists of a <name> (typeof: string) and a
121           <value> (typeof: integer).
122           ·   The state can be addressed as a CSS class in the style.css. The
123               name of the CSS class is the <name> of the state.   Each class
124               gets activated when the current capacity is equal or below the
125               configured <value>.
126           ·   Also each state can have its own format. Those con be config‐
127               ured via format-<name>. Or if you want to differentiate a bit
128               more even as format-<status>-<state>. For more information see
129               custom-formats.
130
131

EXAMPLES

133           "battery": {
134               "bat": "BAT2",
135               "interval": 60,
136               "states": {
137                   "warning": 30,
138                   "critical": 15
139               },
140               "format": "{capacity}% {icon}",
141               "format-icons": ["", "", "", "", ""],
142               "max-length": 25
143           }
144

STYLE

146       ·   #battery
147       ·   #battery.<status>
148           ·   <status> is the value of /sys/class/power_supply/<bat>/status
149               in lowercase.
150       ·   #battery.<state>
151           ·   <state> can be defined in the config. For more information see
152               states.
153       ·   #battery.<status>.<state>
154           ·   Combination of both <status> and <state>.
155
156
157
158                                  2020-04-11                 waybar-battery(5)
Impressum