Skip to content

Instantly share code, notes, and snippets.

@cesardeazevedo
Created March 26, 2015 22:19
Show Gist options
  • Save cesardeazevedo/2b486319ffe909992146 to your computer and use it in GitHub Desktop.
Save cesardeazevedo/2b486319ffe909992146 to your computer and use it in GitHub Desktop.
Just to notify me when my notebook is getting hot, my fan doesn't work, i have to blow manually...
# Just to notify me when my notebook is getting hot, my fan doesn't work, i have to blow manually...
maxTemp=85
while [ 1 ]
do
sensors=$(sensors -u)
PHYSICAL_TEMP1=$(echo "$sensors"| awk 'NR==13' | grep -Eo "\s[0-9]{2}")
CORE_0=$(echo "$sensors"| awk 'NR==18' | grep -Eo "\s[0-9]{2}")
CORE_1=$(echo "$sensors"| awk 'NR==23' | grep -Eo "\s[0-9]{2}")
echo $PHYSICAL_TEMP1 $CORE_0 $CORE_1
if [ $PHYSICAL_TEMP1 -gt $maxTemp -o $CORE_0 -gt $maxTemp -o $CORE_1 -gt $maxTemp ]; then
notify-send "Your PC is on fire!!! $PHYSICAL_TEMP1 $CORE_0 $CORE_1"
fi
sleep 1.5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment