battery app using much cpu

Shawn Houston mhouston at gci.net
Sun Oct 12 05:04:43 UTC 2003


Downloaded and installed. This package definately uses less cpu, but I
am getting periodic mouse (touchpad) freezes when using it. I am using
the following script until a working battery applet is found:

#!/bin/sh
 
CAPACITY=`grep 'design capacity:' /proc/acpi/battery/BAT0/info|awk '{
print $3 }'`
STATE=`grep 'remaining capacity:' /proc/acpi/battery/BAT0/state|awk '{
print $3 }'`
AC_ADAPTER=`awk '{ print $2 }' /proc/acpi/ac_adapter/AC/state`
 
CHARGE=$(( ( $STATE * 100 ) / $CAPACITY ))
if [ $AC_ADAPTER = "on-line" ]; then
        echo "Plugged in"
        echo "Current charge: $CHARGE %"
else
        RATE=`grep 'present rate:' /proc/acpi/battery/BAT0/state|awk '{
print $3 }'`
        echo "Running on battery"
        TIME_LEFT_H=$(( $STATE / $RATE ))
        if [ $STATE -gt $RATE ]; then
                TIME_LEFT_M=$(( ( ( $STATE - $RATE ) * 100 ) / $RATE ))
        else
                TIME_LEFT_M=$(( ( $STATE * 100 ) / $RATE ))
        fi
        TIME_LEFT_M=$(( ( $TIME_LEFT_M * 60 ) / 100 ))
        echo "Battery charge remaining: $CHARGE %"
        echo "Time left to run: $TIME_LEFT_H hours $TIME_LEFT_M minutes"
fi
 
Some of the lines got wrapped by evolution, and the time left to run
output is a work of fiction...probably needs an 80% multipier.

-Shawn

On Sat, 2003-10-11 at 09:15, Joel Young wrote:
> Patched gnome-applets at:
> 
> http://www.translingual.com:8080/~jdy/RPMS/
> 
> patched according to:
> 
> http://www.its.caltech.edu/~dmoore/battstat/
> 
> bugzilla entry:
> 
> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=104292
> 
> Joel
> 
> 
> --
> fedora-test-list mailing list
> fedora-test-list at redhat.com
> http://www.redhat.com/mailman/listinfo/fedora-test-list
-- 
Shawn Houston <mhouston at gci.net>





More information about the fedora-test-list mailing list