diff options
author | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-10-21 20:14:37 +0100 |
---|---|---|
committer | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-10-21 20:14:37 +0100 |
commit | 2d17c849c9961578fbbb61bf539dd1df84c5800b (patch) | |
tree | 6281da1c10a64f708419fda90961a629bcd41043 /modules | |
parent | bb788dddf67c67d8ccd8f365187fea4d470a5d11 (diff) |
Added temperature module
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/temperature | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/temperature b/modules/temperature new file mode 100755 index 0000000..19c3de3 --- /dev/null +++ b/modules/temperature @@ -0,0 +1,21 @@ +#!/bin/bash + +# Gets temperature of the CPU +# Dependencies: lm_sensors + +get_temperature() +{ + # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input) + # CPU_TEMP=$(expr $CPU_T / 1000) + + CPU_TEMP="$(sensors | grep temp1 | awk '{print $2}')" + + # elif [ "$CPU_TEMP" -le 10 ]; then + # echo " $CPU_TEMP" + # else + # echo " $CPU_TEMP" + # fi + echo " $CPU_TEMP" +} + +get_temperature |