Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Bash by dzen pm widget ( 16 years ago )
function power_managment {
core1_temp=`cat /sys/class/hwmon/hwmon1/device/temp1_input | cut -c -2`
if [ -e "/sys/class/hwmon/hwmon2/device/temp1_input" ]; then
core2_temp=`cat /sys/class/hwmon/hwmon2/device/temp1_input | cut -c -2`
cpu_temporary="$(( $(( $core1_temp + $core2_temp )) / 2 ))"
else
cpu_temporary="$core1_temp"
fi
## add this for numeric battery status
battery="`acpi | awk '{ print $4 }' | sed -e 's/,//' -e 's/%//'`"
battery_meter="^p(;+5)`(echo $battery) | $gdbar -max 100`^p()"
ac_adapter=`acpi -a | awk ' /on-line|off-line/ { print $3 }'`
if [ "$cpu_temporary" -ge "70" ]; then
cpu_temp="CPU^fg(#FF4444)${cpu_temporary}^fg()°C"
elif [ "$cpu_temporary" -ge "55" ]; then
cpu_temp="CPU^fg(#FFFF44)${cpu_temporary}^fg()°C"
else
cpu_temp="CPU^fg($color1)${cpu_temporary}^fg()°C"
fi
if [ "$ac_adapter" = "off-line" ]; then
if [ "$battery" -le 25 ]; then
fgw="#FF4444"
power_adapter="BT$battery_meter"
elif [ "$battery" -le 40 ]; then
fgw="#FFFF44"
power_adapter="BT$battery_meter"
elif [ "$battery" -le 70 ]; then
fgw="#44FF44"
power_adapter="BT$battery_meter"
else
fgw="white"
power_adapter="BT$battery_meter"
fi
elif [ "$ac_adapter" = "on-line" ]; then
fgw=$color1
power_adapter="AC$battery_meter"
fi
}
Revise this Paste