Wrong Battery Charge Level Displayed - How to Fix
#8
Here's a temporary workaround as long as you have gxmessage installed (and tuptime, if you want an accurate uptime between boots). For US weather, enter your own zipcode.

Code:
batt1="$(cat /sys/class/power_supply/ip5xxx-battery/capacity)"
batt2="$(cat /sys/class/power_supply/axp20x-battery/capacity)"
batt3="= $(($batt1 + $batt2))%"
uptime="$(sudo tuptime | awk -F'=' '/System uptime:/ {print substr($2, 1, length($2)-3)}')"
weather="$(curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=20902 \ | sed -n '/Currently:/ s/.*: \(.*\): \([0-9]*\)\([CF]\).*/\2°\3 \1/p')"
s="battery: $batt1% + $batt2% $batt3\n\nuptime: $uptime\n\nweather: $weather"
echo -e $s | gxmessage -file -


And that will produce, via gxmessage:


Code:
battery: 100% + 98% = 198%

uptime: 1d 0h 52m

weather: 64°F Partly Cloudy
  Reply


Messages In This Thread
RE: Wrong Battery Charge Level Displayed - How to Fix - by jakfish - 06-12-2023, 01:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Increasing battery life slondr 8 4,698 03-19-2024, 02:15 PM
Last Post: aular
  Genode OS Now Live (finally a battery friendly PP OS?) PineFone 0 1,729 02-04-2023, 09:38 AM
Last Post: PineFone
  Interested in learning OS-level programming 8453sixtyfour 6 7,340 04-30-2022, 05:10 PM
Last Post: TRS-80
  Megapixels 1.3.0 - colors feels wrong hashfactory 0 1,320 09-11-2021, 09:26 AM
Last Post: hashfactory
  Pine phone Battery life vs operating system bcnaz 19 23,898 08-27-2021, 09:35 PM
Last Post: bcnaz
  Battery Charge Status not reporting correctly? (KDE Community Edition) Gregorius Techneticies 11 10,476 02-12-2021, 01:01 PM
Last Post: Giddyup
  Battery life for various OS & UI lat 8 11,078 12-21-2020, 08:20 PM
Last Post: ryo
  Low Battery indication (Manjaro/PostmarketOS with phosh) MamlinAV 3 5,165 12-16-2020, 03:44 AM
Last Post: dukla2000
  theoretical battery life on Pinephone hiimtye 6 7,633 12-12-2020, 01:48 AM
Last Post: jmorris

Forum Jump:


Users browsing this thread: 2 Guest(s)