i3 / i3status

Generates status bar to use with i3bar, dzen2 or xmobar
BSD 3-Clause "New" or "Revised" License
598 stars 251 forks source link

Neither "battery all" nor "battery sbs-6-000b" work #523

Open nabijaczleweli opened 7 months ago

nabijaczleweli commented 7 months ago

In my stock config I have

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.

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,

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.