Skip to content

Instantly share code, notes, and snippets.

@joaomoreno
Last active September 23, 2019 20:28
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 joaomoreno/51615f21639a20f59504660fbf7286bc to your computer and use it in GitHub Desktop.
Save joaomoreno/51615f21639a20f59504660fbf7286bc to your computer and use it in GitHub Desktop.
Plot CPU temperatures with

This plots the CPU temperature of the past 2 minutes in the terminal using spark.

Example run:

current: 58.0
▅▅▄▅▅▅▃▃▃▂▂▂▁▂▂▁▂▂▂▂▂▂▂▂▃▃▃▃▄▃▄▃▅▃▅▄▅▅▆█▆██▆▆█▆
#!/bin/sh
FILE=$(mktemp)
while true; do vcgencmd measure_temp | egrep -o '[0-9]+\.[0-9]+'; sleep 1; done > $FILE &
PID=$!
trap "kill $PID" INT
watch -n 1 --no-title "echo -n \"current: \" && tail -1 $FILE && tail -n 120 $FILE | spark"
rm -f $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment