summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
authori-c-u-p <96894903+i-c-u-p@users.noreply.github.com>2022-07-05 21:40:16 +0000
committerGitHub <noreply@github.com>2022-07-05 21:40:16 +0000
commitf25687ad7841b85b02b06555163ad6c409ec8af0 (patch)
treebe2cea99452ed027c281895ed9adab1e0f552672 /.local/bin/statusbar
parent688ea20708534d7f37a69f5b3adbc6cb90821d7c (diff)
downloadeibhear-f25687ad7841b85b02b06555163ad6c409ec8af0.tar.gz
eibhear-f25687ad7841b85b02b06555163ad6c409ec8af0.tar.zst
eibhear-f25687ad7841b85b02b06555163ad6c409ec8af0.zip
change if statement to case (#1137)
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar/sb-doppler17
1 files 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" ;}