Learn about Linux
Download Linux
Get Linux help
Get special offers on:
Linux Application Dev Programming Software
Email:
#
Return to Improved ways to suspend and hibernate a laptop under Linux
© Copyright 1999-2008 - SourceForge, Inc., All Rights Reserved About Linux.com - Privacy Statement - Terms of Use - Advertise - Trademark - Ask Linux Questions - Write for Us - RSS Feed ThinkGeek - Slashdot - SourceForge.net - freshmeat - Surveys - Jobs
Re:Improve the AVG calc
Posted by: Administrator on February 17, 2007 12:35 PMcount=0
for batery in `ls -1A<nobr> <wbr></nobr>/proc/acpi/battery/`; do
bat_dir="/proc/acpi/battery/$batery/"
AVG[$count]=awk "/remaining/ {a=\"`awk '/last full/ {print $4}' $bat_dir/info`\"; avg=\$3*100/a; print avg}" $bat_dir/state
let count++
done
if [ "${AVG[0]}" -lt '4' ] && [ "${AVG[1]}" -lt '4' ]; then
This way you will prevent the hibernation when the first battery runs out.
#