diff options
| author | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 15:46:58 +0000 |
|---|---|---|
| committer | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 15:46:58 +0000 |
| commit | 0233290c51b5d2f4a0c341a9d731b3237a60bdc2 (patch) | |
| tree | 6ccee927c8a0c3d400346f4a578bd588917599ce /modules/cputemp | |
| parent | c902c352f33332dcfe22a32845cc94d31bead9db (diff) | |
Adjustments to some modules
Diffstat (limited to 'modules/cputemp')
| -rwxr-xr-x | modules/cputemp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/cputemp b/modules/cputemp index 7563835..da8f183 100755 --- a/modules/cputemp +++ b/modules/cputemp @@ -3,19 +3,23 @@ # Gets temperature of the CPU # Dependencies: lm_sensors +PREFIX=' ' +FIRE=' ' + +WARNING_LEVEL=80 + get_cputemp() { # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input) # CPU_TEMP=$(expr $CPU_T / 1000) - CPU_TEMP="$(sensors | grep temp1 | awk 'NR==1{gsub("+", " "); gsub("\\..", " "); print $2"°C"}')" + CPU_TEMP="$(sensors | grep temp1 | awk 'NR==1{gsub("+", " "); gsub("\\..", " "); print $2}')" + + if [ "$CPU_TEMP" -ge $WARNING_LEVEL ]; then + PREFIX="$FIRE$PREFIX" + fi - # elif [ "$CPU_TEMP" -le 10 ]; then - # echo " $CPU_TEMP" - # else - # echo " $CPU_TEMP" - # fi - echo " $CPU_TEMP" + echo "$PREFIX$CPU_TEMP°C" } get_cputemp |
