.\" Generated by scdoc 1.10.0 .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "waybar-battery" "5" "2019-12-31" .P .SH NAME .P waybar - battery module .P .SH DESCRIPTION .P The \fBbattery\fR module displays the current capacity and state (eg. charging) of your battery. .P .SH CONFIGURATION .P \fBbat\fR .br typeof: string .br The battery to monitor, as in /sys/class/power_supply/ instead of auto detect. .P \fBadapter\fR .br typeof: string .br The adapter to monitor, as in /sys/class/power_supply/ instead of auto detect. .P \fBinterval\fR .br typeof: integer .br default: 60 .br The interval in which the information gets polled. .P \fBstates\fR .br typeof: array .br A number of battery states which get activated on certain capacity levels. See \fBwaybar-states(5)\fR. .P \fBformat\fR .br typeof: string .br default: {capacity}% .br The format, how the time should be displayed. .P \fBformat-time\fR .br typeof: string .br default: {H} h {M} min .br The format, how the time should be displayed. .P \fBformat-icons\fR .RS 4 typeof: array/object Based on the current capacity, the corresponding icon gets selected. .br The order is \fBlow\fR to \fBhigh\fR. Or by the state if it is an object. .P .RE \fBmax-length\fR .br typeof: integer .br The maximum length in character the module should display. .P \fBrotate\fR .br typeof: integer .br Positive value to rotate the text label. .P \fBon-click\fR .br typeof: string .br Command to execute when clicked on the module. .P \fBon-click-right\fR .br typeof: string .br Command to execute when you right clicked on the module. .P \fBon-scroll-up\fR .br typeof: string .br Command to execute when scrolling up on the module. .P \fBon-scroll-down\fR .br typeof: string .br Command to execute when scrolling down on the module. .P \fBsmooth-scrolling-threshold\fR .br typeof: double .br Threshold to be used when scrolling. .P \fBtooltip\fR .br typeof: bool .br default: true .br Option to disable tooltip on hover. .P .SH FORMAT REPLACEMENTS .P \fB{capacity}\fR: Capacity in percentage .P \fB{icon}\fR: Icon, as defined in \fBformat-icons\fR. .P \fB{time}\fR: Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average. .P .SH TIME FORMAT .P The \fBbattery\fR module allows you to define how time should be formatted via \fBformat-time\fR. .P The two arguments are: \fB{H}\fR: Hours \fB{M}\fR: Minutes .P .SH CUSTOM FORMATS .P The \fBbattery\fR module allows to define custom formats based on up to two factors. The best fitting format will be selected. .P \fBformat-\fR: With \fBstates\fR, a custom format can be set depending on the capacity of your battery. .P \fBformat-\fR: With the status, a custom format can be set depending on the status in /sys/class/power_supply//status (in lowercase). .P \fBformat--\fR: You can also set a custom format depending on both values. .P .SH STATES .P .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} Every entry (\fBstate\fR) consists of a \fB\fR (typeof: \fBstring\fR) and a \fB\fR (typeof: \fBinteger\fR). .RS 4 .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} The state can be addressed as a CSS class in the \fBstyle.css\fR. The name of the CSS class is the \fB\fR of the state. Each class gets activated when the current capacity is equal or below the configured \fB\fR. .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} Also each state can have its own \fBformat\fR. Those con be configured via \fBformat-\fR. Or if you want to differentiate a bit more even as \fBformat--\fR. For more information see \fBcustom-formats\fR. .RE .P .P .P .RE .SH EXAMPLES .P .nf .RS 4 "battery": { "bat": "BAT2", "interval": 60, "states": { "warning": 30, "critical": 15 }, "format": "{capacity}% {icon}", "format-icons": ["", "", "", "", ""], "max-length": 25 } .fi .RE .P .SH STYLE .P .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#battery\fR .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#battery.\fR .RS 4 .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB\fR is the value of /sys/class/power_supply//status in lowercase. .RE .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#battery.\fR .RS 4 .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB\fR can be defined in the \fBconfig\fR. For more information see \fBstates\fR. .RE .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#battery..\fR .RS 4 .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} Combination of both \fB\fR and \fB\fR. .RE