Comments (8)
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.
Or would an option to manually specify the battery number be better?
from i3blocks-contrib.
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.
Sorry for the delay. Would you please test my proposed fix at kb100@150f4b9
from i3blocks-contrib.
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.
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.
Try that commit. It takes time remaining from the first battery that reports it.
from i3blocks-contrib.
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)
- volume-pipewire is not able to forward default sink when clicked on HOT 1
- confusing formatting in rofi-calendar
- bandwidth2: missing dependency
- temperature block shows wrong temperature
- The cpu_usage2 blocklet isn't working HOT 1
- The blocklet battery-poly isn't working HOT 2
- only appears the clock with date
- key_layout doesn't work because it doesn't output a \n at the end HOT 1
- Root Makefile errors
- Using Font Awesome 6 instead of Font Awesome 5 for dunst
- apt-upgrades
- Issue with Icons in volume-pipewire
- The memory2 block uses incorrect math to calculate ram usage HOT 1
- volume-pulseaudio higher than 100%
- calendar: calendar display at wrong position for different i3 bar position HOT 2
- [bandwidth] tailscale showing as "down"
- [volume_pulse] grep warning
- [mediaplayer] no output if metadata invalid
- [mediaplayer][rfc] make MPRIS a hard dependency?
- The module `cpu_usage2` doesn't compile with clang/llvm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks-contrib.