dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
21.88k stars 1.76k forks source link

🔧 [fix] battery bar elapsed maths incorrect #2275 #2276

Open mightbesimon opened 1 year ago

mightbesimon commented 1 year ago

Description

Battery at 94% charged (so 6% used). barinfo shows 94% elapsed when it should show 6% elapsed. line 3844 to 3846 should say $((100-${battery/\%*})) instead of ${battery/\%*}

incorrect actual behaviour: actual

expected behaviour: expected

Features

Issues

fixes: #2275

TODO

hykilpikonna commented 1 year ago

Maybe it would be better to make this an option of how it should be displayed, like --battery_bar_used.

With this pr, the remaining battery would be "draining" from left to right, which is kind of counterintuitive but also matches with the CPU and RAM progress bars (i.e. the green bar is the remaining). So I guess there is a valid argument on both sides of the choice.