polybar: hide recycling collection indicator when no collection today or
tomorrowmain
parent
71640dfd58
commit
e07aaedfef
|
@ -30,9 +30,16 @@ data="$(curl -s "https://www.real.sammelkalender.ch/app/appSammeldaten.php?nGem=
|
||||||
collection_today="$(echo "$data" | jq -r ".[] | select(.DATUM == \"$today\") | .AbarOne")"
|
collection_today="$(echo "$data" | jq -r ".[] | select(.DATUM == \"$today\") | .AbarOne")"
|
||||||
collection_tomorrow="$(echo "$data" | jq -r ".[] | select(.DATUM == \"$tomorrow\") | .AbarOne")"
|
collection_tomorrow="$(echo "$data" | jq -r ".[] | select(.DATUM == \"$tomorrow\") | .AbarOne")"
|
||||||
|
|
||||||
|
has_printed=0
|
||||||
if [[ "$collection_today" != "null" ]]; then
|
if [[ "$collection_today" != "null" ]]; then
|
||||||
format_collections $collection_today
|
format_collections $collection_today
|
||||||
|
has_printed=1
|
||||||
fi
|
fi
|
||||||
if [[ "$collection_tomorrow" != "null" ]]; then
|
if [[ "$collection_tomorrow" != "null" ]]; then
|
||||||
echo "tomorrow: $(format_collections $collection_tomorrow)"
|
echo "tomorrow: $(format_collections $collection_tomorrow)"
|
||||||
|
has_printed=1
|
||||||
|
fi
|
||||||
|
# hide the module
|
||||||
|
if [[ "$has_printed" == "0" ]]; then
|
||||||
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue