osd-game.sh 423 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. cpuTemp() {
  3. CPUTEMP=$(sensors | grep CPU | awk '{print $2}' | grep -o [0-9][0-9]||[0-9][0-9][0-9])
  4. CPUFREQ=$(lscpu | grep MHz | head -n1 | awk '{print $3}')
  5. echo -n "CPU Temp: $CPUTEMP° > CPU Freq: $CPUFREQ"
  6. }
  7. loadAvg() {
  8. la=$(uptime | grep -o :\ [0-9].* | sed s/://g | awk '{print $1}' | sed s/,//g)
  9. echo -n "Load: $la"
  10. }
  11. while true; do
  12. echo -ne "$(cpuTemp) $(loadAvg)\n"
  13. sleep 1
  14. done