Skip to content

Instantly share code, notes, and snippets.

@hyperized
Created November 25, 2020 11:55
Show Gist options
  • Save hyperized/19d80bd9ffb59e9188f336e1aab5b56d to your computer and use it in GitHub Desktop.
Save hyperized/19d80bd9ffb59e9188f336e1aab5b56d to your computer and use it in GitHub Desktop.
Script to display temperature in the console
#!/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