Created
March 26, 2015 22:19
-
-
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...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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