diff --git a/bin/omarchy-notification-wait b/bin/omarchy-notification-wait index 609dc3263503..afc58cd37e61 100755 --- a/bin/omarchy-notification-wait +++ b/bin/omarchy-notification-wait @@ -7,6 +7,7 @@ set -uo pipefail timeout=${1:-10} +deadline=$((SECONDS + timeout)) notification_server_ready() { busctl --user call \ @@ -18,12 +19,10 @@ notification_server_ready() { # The shell has to be up to serve the IPC, and it has to have claimed the # notification bus name before notify-send has anywhere to deliver. -attempts=$((timeout * 10)) -while (( attempts > 0 )); do +while (( SECONDS < deadline )); do if omarchy-shell notifications ping >/dev/null 2>&1 && notification_server_ready; then exit 0 fi - attempts=$((attempts - 1)) sleep 0.1 done