Index of /andrejciho/Linux/My processor/battery info script

Post Title Posted Description
Back Parent Directory
My processor/battery info script 2006-03-21 12:57

Shows me info about processor speed, temperature, battery life, etc.


Be Sociable, Share!

So here’s my code as Topher requested. It basically shows me info about processor speed, temperature (in Farenheit and Celsius), battery life, etc.
echo " CPU running at "`cpufreq-info -fm`
acpi -tB
acpi -tBf
echo " "
acpi -b
echo " "`acpi -aTB`
echo " "`more /proc/acpi/battery/BAT0/info | grep -i "design capacity:"`
echo " "`more /proc/acpi/battery/BAT0/info | grep -i "last full capacity:"`
DESIGN=`more /proc/acpi/battery/BAT0/info | grep -i "design capacity:" | gawk '{print $3}'`
LAST=`more /proc/acpi/battery/BAT0/info | grep -i "last full capacity:" | gawk '{print $4}'`
PERCENTAGE=$(echo "scale=2; (${LAST}/${DESIGN})*100" | bc -l)
PERCENTAGE=$(echo "scale=0; ${PERCENTAGE}" | bc -l)
echo " last real charge: ${PERCENTAGE}%"

and this is what I get on my computer:
CPU running at 800 MHz
Thermal 1: ok, 46.0 degrees C
Thermal 1: ok, 114.8 degrees F
Battery 1: discharging, 99%, 02:09:38 remaining
AC Adapter 1: off-line
design capacity: 4800 mAh
last full capacity: 3539 mAh
last real charge: 73.00%


Leave a Comment
*Required
*Required (Never published)
 

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

This website is powered by Wordpress