Expand description
Information about the internal power supply
This block can display the current battery state (Full, Charging or Discharging), percentage charged and estimate time until (dis)charged for an internal power supply.
§Configuration
Key | Values | Default |
---|---|---|
device | sysfs/UPower: The device in /sys/class/power_supply/ to read from (can also be “DisplayDevice” for UPower, which is a single logical power source representing all physical power sources. This is for example useful if your system has multiple batteries, in which case the DisplayDevice behaves as if you had a single larger battery.). apc_ups: IPv4Address:port or hostname:port | sysfs: the first battery device found in /sys/class/power_supply, with “BATx” or “CMBx” entries taking precedence. apc_ups: “localhost:3551”. upower: DisplayDevice |
driver | One of "sysfs" , "apc_ups" , or "upower" | "sysfs" |
model | If present, the contents of /sys/class/power_supply/.../model_name must match this value. Typical use is to select by model name on devices that change their path. | N/A |
interval | Update interval, in seconds. Only relevant for driver = “sysfs” or “apc_ups”. | 10 |
format | A string to customise the output of this block. See below for available placeholders. | " $icon $percentage " |
full_format | Same as format but for when the battery is full | " $icon " |
charging_format | Same as format but for when the battery is charging | Links to format |
empty_format | Same as format but for when the battery is empty | " $icon " |
not_charging_format | Same as format but for when the battery is not charging. Defaults to the full battery icon as many batteries report this status when they are full. | " $icon " |
missing_format | Same as format if the battery cannot be found. | " $icon " |
info | Minimum battery level, where state is set to info | 60 |
good | Minimum battery level, where state is set to good | 60 |
warning | Minimum battery level, where state is set to warning | 30 |
critical | Minimum battery level, where state is set to critical | 15 |
full_threshold | Percentage above which the battery is considered full (full_format shown) | 95 |
empty_threshold | Percentage below which the battery is considered empty | 7.5 |
Placeholder | Value | Type | Unit |
---|---|---|---|
icon | Icon based on battery’s state | Icon | - |
percentage | Battery level, in percent | Number | Percents |
time_remaining | Time remaining until (dis)charge is complete. Presented only if battery’s status is (dis)charging. | Duration | - |
time | Time remaining until (dis)charge is complete. Presented only if battery’s status is (dis)charging. | String DEPRECATED | - |
power | Power consumption by the battery or from the power supply when charging | String or Float | Watts |
time
has been deprecated in favor of time_remaining
.
§Examples
Basic usage:
[[block]]
block = "battery"
format = " $icon $percentage "
[[block]]
block = "battery"
format = " $percentage {$time_remaining.dur(hms:true, min_unit:m) |}"
device = "DisplayDevice"
driver = "upower"
Hide missing battery:
[[block]]
block = "battery"
missing_format = ""
§Icons Used
bat
(as a progression)bat_charging
(as a progression)bat_not_available