Created
November 25, 2020 11:55
-
-
Save hyperized/19d80bd9ffb59e9188f336e1aab5b56d to your computer and use it in GitHub Desktop.
Script to display temperature in the console
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
#!/usr/bin/env bash | |
# Run like: ./temperature.sh & | |
# Requires sensors and smartctl | |
while true; do | |
tput sc | |
tput cup 0 $(($(tput cols)-74)) | |
cpu=$(sensors | grep temp1 | awk '{print $2}') | |
hdd=$(sudo smartctl -d auto -A /dev/sda | grep "Sensor 1" | awk -F': *' '{print $2}') | |
echo "CPU: $cpu | HDD1: $hdd" | |
tput rc | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment