fix(polybar): fix weather entry

This commit is contained in:
Pavel Korytov 2021-01-20 17:39:09 +03:00
parent d578d31d6a
commit dfc9956cb8
2 changed files with 7 additions and 3 deletions

View file

@ -38,6 +38,9 @@ for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
fi
SIZE=${FONT_SIZES[$MONITOR]}
SCALE=${EMOJI_SCALE[$MONITOR]}
if [[ -z "$SCALE" ]]; then
continue
fi
export FONT0="pango:monospace:size=$SIZE;1"
export FONT1="NotoEmoji:scale=$SCALE:antialias=false;1"
export FONT2="fontawesome:pixelsize=$SIZE;1"

View file

@ -5,10 +5,11 @@ format_1=${FORMAT_1:-"qF"}
format_2=${FORMAT_1:-"format=v2n"}
bar_weather=$(curl -s wttr.in/${location}?format=${bar_format} || echo "??")
if [ -z ${bar_weather} ]; then
if [ -z "$bar_weather" ]; then
exit 1
elif [[ ${bar_weather} == *"Unknown"* ]]; then
elif [[ "$bar_weather" == *"Unknown"* || "$bar_weather" == *"Sorry"* || "$bar_weather" == *"Bad Gateway"* ]]; then
echo "??"
exit 1
else
echo ${bar_weather}
fi
echo ${bar_weather}