Merge pull request #187 from jaesivsm/enhance/temp

Enhance/temp
This commit is contained in:
nojhan 2013-05-22 12:02:43 -07:00
commit 73599b07e9

View File

@ -1224,15 +1224,15 @@ _lp_load_color()
######################
_lp_temp_sensors() {
# Return the average system temperature we get through the sensors command
local count=0
# Return the hottest system temperature we get through the sensors command
local temperature=0
for i in $(sensors | grep -E "^(Core|temp)" |
for i in $(sensors | grep -E "^(CPU|SYS|MB|Core|temp).*°(C|F)" |
sed -r "s/.*: *\+([0-9]*)\..°.*/\1/g"); do
temperature=$(($temperature+$i))
count=$(($count+1))
if [[ $i -gt $temperature ]]; then
temperature=$i
fi
done
echo -ne "$(($temperature/$count))"
echo -ne "$temperature"
}
# Will set _lp_temp_function so the temperature monitoring feature use an