Skip to content

hitomitaiho/battery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

#查看出厂设计容量 cc=$(cat /sys/class/power_supply/battery/charge_full_design) charge_full_design=$((

You can't use 'macro parameter character #' in math mode

$cc / 1000))
#查看当前电池容量
dc=$
(cat /sys/class/power_supply/battery/charge_full) charge_full=$((
You can't use 'macro parameter character #' in math mode

$dc / 1000))
#查看电池循环次数
xh=$
(cat /sys/class/power_supply/battery/cycle_count) #计算剩余容量百分比 bfb=$(printf "%d" ( ( {dc}*100/${cc}))) echo echo ————————————————————————— echo "出厂设计容量为 c h a r g e f u l l d e s i g n m A h " e c h o e c h o " {charge_full}mAh" echo echo "电池循环次数为 $xh次" echo echo "剩余容量百分比为 $bfb%" echo ————————————————————————— echo

battery

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published