Handle missing weather data

This commit is contained in:
Ohad Livne 2025-06-04 22:44:44 +03:00
parent f2d9d0f1ea
commit 85d88f7d74
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -36,6 +36,11 @@ case "${battery_state}" in
;; ;;
esac esac
weather=$(cat /tmp/weather-report.txt) weather_file="/tmp/weather-report.txt"
if [ -f ${weather_file} ]; then
weather=$(cat ${weather_file})
else
weather=""
fi
echo ${weather} 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}% echo ${weather} 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%