From e07aaedfef89e45532bc7b02e5c87702559dbd60 Mon Sep 17 00:00:00 2001 From: maia arson crimew Date: Sun, 5 Jun 2022 12:56:50 +0200 Subject: [PATCH] polybar: hide recycling collection indicator when no collection today or tomorrow --- .config/polybar/scripts/real.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/polybar/scripts/real.sh b/.config/polybar/scripts/real.sh index a496dc2..6661905 100755 --- a/.config/polybar/scripts/real.sh +++ b/.config/polybar/scripts/real.sh @@ -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_tomorrow="$(echo "$data" | jq -r ".[] | select(.DATUM == \"$tomorrow\") | .AbarOne")" +has_printed=0 if [[ "$collection_today" != "null" ]]; then format_collections $collection_today + has_printed=1 fi if [[ "$collection_tomorrow" != "null" ]]; then echo "tomorrow: $(format_collections $collection_tomorrow)" + has_printed=1 +fi +# hide the module +if [[ "$has_printed" == "0" ]]; then + echo "" fi