Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nabijaczleweli opened this issue Feb 4, 2024 · 0 comments
Open

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

nabijaczleweli opened this issue Feb 4, 2024 · 0 comments

Comments

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented Feb 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant