From f25687ad7841b85b02b06555163ad6c409ec8af0 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:40:16 +0000 Subject: [PATCH] change if statement to case (#1137) --- .local/bin/statusbar/sb-doppler | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index 91ec310..26d37b4 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -251,16 +251,13 @@ getdoppler() { cont="$(sed "s/,.*//" "$radarloc")" loc="$(cut -c 4- "$radarloc")" notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." - if [ "$cont" = "US" ] ; then - curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ; - elif [ "$cont" = "EU" ] ; then - curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ; - elif [ "$cont" = "AF" ] ; then - curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ; - elif [ "$cont" = "DE" ] ; then - loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")" - curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ; - fi + case "$cont" in + "US") curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;; + "EU") curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;; + "AF") curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;; + "DE") loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")" + curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;; + esac } showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}