Neither "battery all" nor "battery sbs-6-000b" work
- Dominant language
- C
- Stars
- 653
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
In [my stock config](https://github.com/nabijaczleweli/topfig/blob/master/.config/i3status/config) I have
```perl
order += "battery all"
battery all {
format = "%status %percentage %remaining"
low_threshold = "5"
threshold_type = "time"
}
```
which no longer works, and yields `{"name":"battery","markup":"none","full_text":"No battery"}`.
Categorically untrue – see #521.
The manual says
```
To show an aggregate of all batteries in the system, use "all" as the number. In
this case (for Linux), the /sys path must contain the "%d" sequence. Otherwise,
the number indicates the battery index as reported in /sys.
```
but I don't see such an "index" attested at all (via `grep -i index *`).
So somehow `battery all` doesn't find any batteries in my two power supplies – `CROS_USBPD_CHARGER` with type=USB and `sbs-6-000b` with type=Battery.
---
This means I need to configure this battery explicitly presumably.
```perl
order += "battery sbs-6-000b"
battery sbs-6-000b {
format = "%status %percentage %remaining"
low_threshold = "5"
threshold_type = "time"
}
```
yields `{"name":"battery","instance":"/sys/class/power_supply/BAT0/uevent","markup":"none","full_text":"No battery"}`.
(Same for `battery "sbs-6-000b" {`.)
No clue where it got "BAT0" given the explicit configuration of "sbs-6-000b", accepted with no warnings or errors.
The manual says
```
If your battery is represented in a non-standard path in /sys, be sure to
modify the +path+ property accordingly, i.e. pointing to the uevent file on
your system.
```
but the path to my battery is perfectly standard, matching the `sbs-%s` (where %s is the name (address) of the device itself) format. You could make this argument for some device-specific drivers, but this isn't one them.
Is this somehow bizarrely nomenclaturally married to some specific driver?
But indeed,
```perl
order += "battery sbs-6-000b"
battery sbs-6-000b {
path = "/sys/class/power_supply/sbs-6-000b/uevent"
format = "%status %percentage %remaining"
low_threshold = "5"
threshold_type = "time"
}
```
works, but I don't really see what the point of the argument to `battery` is, then.
Contributor guide
Assessment
This issue has not been assessed yet.