summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar/sb-forecast
diff options
context:
space:
mode:
authorsban <30375170+mr-sban@users.noreply.github.com>2023-09-05 07:51:05 +0000
committerGitHub <noreply@github.com>2023-09-05 07:51:05 +0000
commitb8cd0ab4953d053fef09c48ba04f2fbb2df57aa4 (patch)
tree5c0f4f7add0bb4597f6bb208c39092eedda7682d /.local/bin/statusbar/sb-forecast
parentc550a7c6e54fba8d4cf6024b2ffcf2a475367bd3 (diff)
downloadeibhear-b8cd0ab4953d053fef09c48ba04f2fbb2df57aa4.tar.gz
eibhear-b8cd0ab4953d053fef09c48ba04f2fbb2df57aa4.tar.zst
eibhear-b8cd0ab4953d053fef09c48ba04f2fbb2df57aa4.zip
Timeout added to forecast module, ncmpcpp now tracks player state (#1359)
* Added timeout to getforecast to prevent status bar breakage. A 2 second timeout is used in the case that wttr.in is inaccessible when dwm is started; as otherwise it tries to curl wttr.in indefinitely, not allowing other status bar modules to be loaded. * Update music status bar module on player state change
Diffstat (limited to '.local/bin/statusbar/sb-forecast')
-rwxr-xr-x.local/bin/statusbar/sb-forecast2
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast
index 368c17f..d8a16aa 100755
--- a/.local/bin/statusbar/sb-forecast
+++ b/.local/bin/statusbar/sb-forecast
@@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
# Get a weather report from 'wttr.in' and save it locally.
-getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
+getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
# Forecast should be updated only once a day.
checkforecast() {