Skip to content

Instantly share code, notes, and snippets.

@PhillipJacobsen
Last active July 23, 2023 14:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PhillipJacobsen/b829bdcd8f345431479ac2aa1f0de8da to your computer and use it in GitHub Desktop.
Save PhillipJacobsen/b829bdcd8f345431479ac2aa1f0de8da to your computer and use it in GitHub Desktop.
#!/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
@jaw709
Copy link

jaw709 commented May 31, 2022

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!

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