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 |