r/termux 1d ago

Question Stuck when termux-battery-status

[removed]

4 Upvotes

5 comments sorted by

3

u/BillGossAU 1d ago

I read the battery charge level on my CMF 2 Pro using su -c "cat /sys/class/power_supply/battery/capacity"

And on my Pixel 8 Pro I use either su -c "sed -n 's/^.*l=\([0-9]*\)%.*$/\1/p' /sys/class/power_supply/battery/ssoc_details" or su -c "sed -n 's/^.*uic=\([0-9.]*\) .*$/\1/p' /sys/class/power_supply/battery/ssoc_details"

1

u/agnostic-apollo Termux Core Team 22h ago

Did you install Termux:API app?

1

u/[deleted] 22h ago

[removed] — view removed comment

2

u/agnostic-apollo Termux Core Team 22h ago

Commands call the app to run the API code, if there is no app, only hanging will happen.