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

battery script stopped showing proper percentage #258

Closed
stef204 opened this issue Oct 9, 2017 · 5 comments
Closed

battery script stopped showing proper percentage #258

stef204 opened this issue Oct 9, 2017 · 5 comments

Comments

@stef204
Copy link

stef204 commented Oct 9, 2017

the battery script in the "scripts" repo which I have used for ages has stopped working properly and behaves as such: as soon as X starts and i3-wm launches, I can see proper number for battery. Once it refreshes, it gets stuck on battery 0% red color.

The 0% is incorrect. This has just started to happen recently.

% acpi -b  
Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Discharging, 88%, 02:01:52 remaining
Battery 2: Discharging, 0%, rate information unavailable

So it no longer is picking up the right battery (BAT1) and reading BAT0 or BAT2. Note: I only have 1 single battery (BAT1) in this laptop.

Could be due to changes in kernel or acpi ?

% uname -sr Linux 4.13.4

Note: having similar problems with battery.py from i3blocks-contrib and batterybar (this one shows status for 3 batteries when only 1 is present.)

@stef204
Copy link
Author

stef204 commented Oct 9, 2017

Temp fix, changing this line from
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
to
open (ACPI, "acpi -b | grep -v 'unavailable' |") or die;

fixes the issue for now but probably not ideal.

@ghost
Copy link

ghost commented May 15, 2018

Having exactly the same trouble, the "fix" indeed works, thanks ;)

It's weird, extra batteries are only appearing after sleep on my PC (zenbook).

@stef204
Copy link
Author

stef204 commented May 20, 2018

@archvill This could be distro specific, not sure. ACPI state changes on and off, etc. Ideally, the script would detect the proper battery (or batteries) and state changes dynamically. "Quick and dirty" fix above OK for now.

@ghost
Copy link

ghost commented May 21, 2018

@stef204 agreed, BTW I'm using Arch.

Linux srv 4.16.9-1-ARCH #1 SMP PREEMPT Thu May 17 02:10:09 UTC 2018 x86_64 GNU/Linux

@vivien
Copy link
Owner

vivien commented Sep 7, 2018

The scripts are now exclusively maintained in the i3blocks-contrib repository, thanks!

@vivien vivien closed this as completed Sep 7, 2018
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