Explorar el Código

Add colors to temperature status section

Frans Bergman hace 4 años
padre
commit
81d2e9be64
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      .scripts/status/40-temp.sh

+ 11 - 1
.scripts/status/40-temp.sh

@@ -1,2 +1,12 @@
 #!/bin/sh
-sensors | awk '/Package/{print $4}'
+
+TEMP="$(sensors | awk '/Package/{print $4}')"
+NUMTEMP="$(echo "$TEMP" | tr -dc '0-9')"
+if [ "$NUMTEMP" -ge 700 ]; then
+    TEMPCOL=""
+elif [ "$NUMTEMP" -ge 500 ]; then
+    TEMPCOL=""
+else
+    TEMPCOL=""
+fi
+echo "$TEMPCOL$TEMP"