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

Questions about BAT0 or BAT1 in battery.sh #455

Open
ycpss91255 opened this issue Dec 12, 2024 · 1 comment
Open

Questions about BAT0 or BAT1 in battery.sh #455

ycpss91255 opened this issue Dec 12, 2024 · 1 comment

Comments

@ycpss91255
Copy link

it doesn't exist on my lattop (LG, Ubuntu 24.04 and Ubuntu 20.04). My laptop only has CMB0. I replaced BAT0 in .sh with CMB0 to make it work properly.

@erikw
Copy link
Owner

erikw commented Feb 8, 2025

Oh look at that. It looks like this code should be a bit smarter and not just assume two names (BAT0 or BAT1):

BATPATH=/sys/class/power_supply/BAT0
if [ ! -d $BATPATH ]; then
BATPATH=/sys/class/power_supply/BAT1

We could look for these most common names (BAT0 or BAT1), or else pick the one other battery name (if any) if those two first one does not exist.

Would you be willing to make a PR? :)

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

2 participants