Skip to content

Instantly share code, notes, and snippets.

@ledangtuanbk
Created February 7, 2020 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ledangtuanbk/08ac772066db51dccaed3e3554052920 to your computer and use it in GitHub Desktop.
Save ledangtuanbk/08ac772066db51dccaed3e3554052920 to your computer and use it in GitHub Desktop.
Warning CPU Temperature
min=20
max=70
temps=($(sensors |grep 'Core'|awk '{print substr($3 , 2 , 2)}'))
for i in "${temps[@]}"
do
temp=$i
if [ $temp -gt $max ] || [ $temp -lt $min ];
then
notify-send "Temperature Warning" "CPU $core $temp°C"
break;
fi
done
@ledangtuanbk
Copy link
Author

ledangtuanbk commented Feb 7, 2020

sudo apt install lm-sensors -y
sudo sensors-detect
sensors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment