diff --git a/modules/module_temp b/modules/module_temp index fdc3305..cccadc1 100755 --- a/modules/module_temp +++ b/modules/module_temp @@ -57,10 +57,10 @@ PRINT() { if [ "$ENABLE_ITEM8" = "true" ]; then if [ -e "${BINDIR}sensors" ]; then if [ "$ITEM8_FORMAT_CELSIUS" = "true" ]; then - echo "$SEPARATOR $ITEM8_ICON $(sensors | grep temp1 | awk '{ print $2 }')" + sensors | grep temp1 | awk '{ print $2 }' | grep -q "C" && echo "$SEPARATOR $ITEM8_ICON $(sensors | grep temp1 | awk '{ print $2 }')" touch /tmp/iscelsius else - echo "$SEPARATOR $ITEM8_ICON $(sensors -f | grep temp1 | awk '{ print $2 }')" + sensors | grep temp1 | awk '{ print $2 }' | grep -q "F" && echo "$SEPARATOR $ITEM8_ICON $(sensors -f | grep temp1 | awk '{ print $2 }')" fi fi fi @@ -72,3 +72,7 @@ case "$ARG1" in "--print") PRINT > /tmp/module_temp ;; "--click") CLICK ;; esac + +if [ "$(cat /tmp/module_temp | wc -c)" -lt "6" ]; then + rm -f /tmp/module_temp +fi