From 6c431a1628d94559120fafe137b3809c89c37763 Mon Sep 17 00:00:00 2001 From: Vincenzo Frascino Date: Fri, 18 Oct 2024 19:26:51 +0100 Subject: [PATCH 1/2] Revert "exported bash functions so that we can add timeout" This reverts commit a3398adda85e05a47e0c505aa49b24cb783d9ec1. --- scripts/weather.sh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/weather.sh b/scripts/weather.sh index c46bc9b..26b45f3 100755 --- a/scripts/weather.sh +++ b/scripts/weather.sh @@ -42,7 +42,6 @@ fetch_weather_information() #get weather display display_weather() { - fahrenheit=$1 if $fahrenheit; then display_weather='&u' # for USA system else @@ -74,24 +73,13 @@ forecast_unicode() fi } -export -f display_weather -export -f display_location -export -f forecast_unicode -export -f fetch_weather_information - main() { # process should be cancelled when session is killed if timeout 1 bash -c " Date: Fri, 18 Oct 2024 19:27:08 +0100 Subject: [PATCH 2/2] Revert "added timeout to the weather_wrapper.sh script" This reverts commit 66e3b0af8e7ae8a1b4b929940be85bc5058abd28. --- scripts/weather_wrapper.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/weather_wrapper.sh b/scripts/weather_wrapper.sh index edf0a43..3356ce8 100755 --- a/scripts/weather_wrapper.sh +++ b/scripts/weather_wrapper.sh @@ -11,7 +11,6 @@ fixedlocation=$3 DATAFILE=/tmp/.dracula-tmux-data LAST_EXEC_FILE="/tmp/.dracula-tmux-weather-last-exec" RUN_EACH=1200 -RETRY_EACH=60 TIME_NOW=$(date +%s) TIME_LAST=$(cat "${LAST_EXEC_FILE}" 2>/dev/null || echo "0") @@ -23,10 +22,6 @@ main() # Run weather script here $current_dir/weather.sh $fahrenheit $location "$fixedlocation" > "${DATAFILE}" echo "${TIME_NOW}" > "${LAST_EXEC_FILE}" - elif grep -q 'Unavailable\|Error' "${DATAFILE}" && [ "$(expr ${TIME_LAST} + ${RETRY_EACH})" -lt "${TIME_NOW}" ]; then - # Run weather script here - $current_dir/weather.sh $fahrenheit $location "$fixedlocation" > "${DATAFILE}" - echo "${TIME_NOW}" > "${LAST_EXEC_FILE}" fi cat "${DATAFILE}"