This commit is contained in:
speedie 2022-11-01 20:47:46 +01:00
parent 995cab4b55
commit 56b5f9a359

View file

@ -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