Commits

Radu Potop  committed 3f22adc

cput

  • Participants
  • Parent commits b6cb736

Comments (0)

Files changed (2)

 #!/bin/bash
 # Get CPU and GPU temperature
 
-sensors | egrep '(Core|CPU)'
-echo
-nvidia-settings -q GPUCoreTemp | grep 'Attribute'
+echo -ne 'CPU\tMB\tGPU\n'
+
+while (true) do
+
+    CPU=`sensors|egrep 'CPU Temperature'|awk '{print $3}'| sed 's/°C//'|sed 's/+//'`
+    MB=`sensors|egrep 'MB Temperature'|awk '{print $3}'| sed 's/°C//'|sed 's/+//'`
+    GPU=`nvidia-settings -q GPUCoreTemp | egrep 'Attribute'|awk '{print $4}'|sed 's/\.//'`
+
+    echo -ne "$CPU\t$MB\t$GPU\n"
+
+    sleep 5
+
+done
 
 while (true) do
     $@
-    echo -e '\n-----------------------------------------\n'
     sleep 5
 done