From 177bcafe9534f1a6b112010500245392497e95a4 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 3 Nov 2026 19:28:59 -0700 Subject: [PATCH] Remove sleeping for 10 seconds at the end of the loop since we're much more precise now. Only sleep for 5 minutes after notification dismissal if we're planning another one. --- sunset-alarm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sunset-alarm b/sunset-alarm index 617cc31..93c0066 100755 --- a/sunset-alarm +++ b/sunset-alarm @@ -229,10 +229,11 @@ while true; do echo "Alert time has been reached, show message." show_alert NOTIFIED="true" - - echo "Alert has been dismissed, sleeping for 5 minutes." - sleep 290 - echo "Waking back up from notification dismissal." + echo "Alert has been dismissed." + if [[ -n "$PERSIST" ]]; then + echo "Sleeping for 5 minutes before next notification." + sleep 300 + fi elif [[ "$SUNSET_EPOCH" == 0 ]]; then echo "ERROR: Sunset time has not been calculated yet, cannot alert." >&2 elif [[ -n "$NOTIFIED" && -z "$PERSIST" ]]; then @@ -248,6 +249,4 @@ while true; do LAST_DATE="" NOTIFIED="" fi - - sleep 10 done