Last active
July 23, 2023 14:56
-
-
Save PhillipJacobsen/b829bdcd8f345431479ac2aa1f0de8da to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
Counter=20 | |
DisplayHeader="Date Time GPU-C GPU-F CPU-C CPU-F CPU Core Vcore" | |
while true ; do | |
let ++Counter | |
if [ ${Counter} -eq 21 ]; then | |
echo -e "${DisplayHeader}" | |
Counter=0 | |
fi | |
Clockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' ) | |
Corespeed=$(vcgencmd measure_clock core | awk -F"=" '{printf ("%0.0f",$2/1000000); }' ) | |
CoreVolt=$(vcgencmd measure_volts | cut -f2 -d= | sed 's/000//') | |
gpu=$(//usr/bin/vcgencmd measure_temp | awk -F "[=']" '{print $2}') | |
# gpu=3 | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
cpu=$(echo "$cpu / 100 * 0.1" | bc) | |
cpuf=$(echo "(1.8 * $cpu) + 32" |bc) | |
gpuf=$(echo "(1.8 * $gpu) + 32" |bc) | |
echo -e "$(date '+%b %d %H:%M') ${gpu}'C ${gpuf}'F ${cpu}'C ${cpuf}'F $(printf '%4s' ${Clockspeed})MHz $(printf '%4s' ${Corespeed})MHz ${CoreVolt}" | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love it! After bricking my first pi OS, I was searching high and low for this and just had to have my favorite script back. Thanks!