環境: Debian 5.0 + 2.6.28
#!/bin/bash now=`/bin/cat /proc/acpi/battery/BAT1/state | awk '/remain/ {print $3}'` full=`/bin/cat /proc/acpi/battery/BAT1/info | awk '/last full/ {print $4}'` declare -i status="$now*100/$full" echo $status
環境: Debian 6.0 + 2.6.32
/sys/class/power_supply/BAT0/charge_now
/sys/class/power_supply/BAT0/charge_full
沒有留言:
張貼留言