Giter Site home page Giter Site logo

Comments (8)

kb100 avatar kb100 commented on August 20, 2024

Hmm, (0+96+0)/3 = 32, so the script is working as intended. The issue here is that acpi is reporting that you have 3 batteries, and that 2 of them are at 0%. Perhaps it would be best to report battery percentage as the average of nonzero battery percentages? Would this suit your needs?

from i3blocks-contrib.

kb100 avatar kb100 commented on August 20, 2024

Or would an option to manually specify the battery number be better?

from i3blocks-contrib.

stef204 avatar stef204 commented on August 20, 2024

Thanks for feedback.
Average of non zero batteries would seem best.

I cannot choose batteries because acpi state changes. It starts by detecting the real battery as "Battery 0", then some time later, changes this to Battery 1. So have to go with

Average of non zero batteries

from i3blocks-contrib.

kb100 avatar kb100 commented on August 20, 2024

Sorry for the delay. Would you please test my proposed fix at kb100@150f4b9

from i3blocks-contrib.

stef204 avatar stef204 commented on August 20, 2024

Thank you. Applied the patch and testing now. Give me a day or 2 to make sure behaves correctly under different circumstances and will report back soon.

from i3blocks-contrib.

stef204 avatar stef204 commented on August 20, 2024

It seems to work OK in detecting the proper charge % now. One thing I noticed, is that if I unplug power, it does not show the "time remaining" from acpi (as displayed below for Battery 1), systematically.

% acpi i
Battery 0: Discharging, 0%, rate information unavailable
Battery 1: Discharging, 97%, 01:53:36 remaining
Battery 2: Discharging, 0%, rate information unavailable

The script + block only show the battery icon and "97%".

If I reboot and then startx with power unplugged, it will show the full text, i.e. % and time remaining. This is useful info.

PS I had a similar problem (as in original post, i.e. script/acpi detecting wrong battery) with the original battery script and have also filed a ticket there. You can see how I have addressed or "fixed" it. That one seems to work properly now.

from i3blocks-contrib.

kb100 avatar kb100 commented on August 20, 2024

kb100@bb5e464

Try that commit. It takes time remaining from the first battery that reports it.

from i3blocks-contrib.

stef204 avatar stef204 commented on August 20, 2024

Discharging

% ./battery
<span font='FontAwesome'></span> <span color="#FFFFFF">83%</span> (01:31)
<span font='FontAwesome'></span> <span color="#FFFFFF">83%</span> (01:31)

Charging

 % ./battery
<span font='FontAwesome'></span> <span color="#FFFFFF">82%</span> (00:17)
<span font='FontAwesome'></span> <span color="#FFFFFF">82%</span> (00:17)

Looks OK, thank you.

from i3blocks-contrib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.