diff --git a/polybar-scripts/notification-spacex/notification-spacex.sh b/polybar-scripts/notification-spacex/notification-spacex.sh index 854c4cdd..0515d2a7 100644 --- a/polybar-scripts/notification-spacex/notification-spacex.sh +++ b/polybar-scripts/notification-spacex/notification-spacex.sh @@ -4,10 +4,10 @@ spacex_launch=$(curl -sf "https://ll.thespacedevs.com/2.2.0/launch/upcoming/?lsp if [ -n "$spacex_launch" ]; then spacex_precision=$(printf "%s" "$spacex_launch" | jq -r '.results[0].net_precision.abbrev' ) - spacex_timestamp=$(date +"%s" --date "$(printf "%s" "$spacex_launch" | jq -r '.results[0].net' )") - spacex_duration=$((spacex_timestamp - $(date +%s))) if [ "$spacex_precision" = "HR" ] || [ "$spacex_precision" = "MIN" ] || [ "$spacex_precision" = "SEC" ]; then + spacex_timestamp=$(date +"%s" --date "$(printf "%s" "$spacex_launch" | jq -r '.results[0].net' )") + spacex_duration=$((spacex_timestamp - $(date +%s))) if [ "$spacex_duration" -lt 43200 ] && [ "$spacex_duration" -gt 0 ]; then echo "# $(date +"%H:%M" -u --date @$spacex_duration)" else