Pow scripts

From Electron Cloud

Jump to: navigation, search
(Apple Intel systems)
Line 74: Line 74:
Since I haven't gotten around to shelling out for a MacBook yet, there is no battery info... maybe later.
Since I haven't gotten around to shelling out for a MacBook yet, there is no battery info... maybe later.
 +
 +
==Lenovo S10-3t==
 +
<pre>
 +
 +
#!/bin/sh
 +
CHARGE_NOW=`cat /sys/class/power_supply/BAT?/charge_now`
 +
CHARGE_FULL=`cat /sys/class/power_supply/BAT?/charge_full`
 +
CHARGE_PERCENT=$(( $CHARGE_NOW * 100 / $CHARGE_FULL ))
 +
CHARGE_NOW=`cat /proc/acpi/battery/BAT?/state | grep remaining | cut -c26-`
 +
CHARGE_FULL=`cat /proc/acpi/battery/BAT?/info | grep last | cut -c26-`
 +
cat /proc/acpi/battery/BAT?/state | grep -v remaining
 +
echo "Charge:                  $CHARGE_NOW / $CHARGE_FULL = $CHARGE_PERCENT%"
 +
for s in `ls -d /sys/devices/virtual/thermal/thermal_zone*`
 +
do
 +
        echo "Temperature `cat $s/type`:      $((`cat $s/temp` / 1000)) °C"
 +
done
 +
echo "Temperature `cat /sys/devices/platform/coretemp.0/temp1_label`:      $((`cat /sys/devices/platform/coretemp.0/temp1_input` / 1000)) °C"
 +
</pre>

Revision as of 16:11, 11 July 2011

Personal tools