From dad2870f583dc2f2555a03181d54b8d675b1aebf Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 8 May 2026 21:44:21 +0200 Subject: [PATCH] Check for weather once a minute instead of once every ten More accurate and deals with the first-boot issue on network too --- config/waybar/config.jsonc | 2 +- default/waybar/weather.sh | 3 --- migrations/1778139028.sh | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index 61a11eca..2b3783b2 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -69,7 +69,7 @@ "custom/weather": { "exec": "$OMARCHY_PATH/default/waybar/weather.sh", "return-type": "json", - "interval": 600, + "interval": 60, "tooltip": false, "on-click": "notify-send -u low \"$(omarchy-weather-status)\"" }, diff --git a/default/waybar/weather.sh b/default/waybar/weather.sh index 0b613d66..02e7bc2b 100755 --- a/default/waybar/weather.sh +++ b/default/waybar/weather.sh @@ -1,8 +1,5 @@ #!/bin/bash -# Delay startup to allow network initialization after boot -sleep 5 - icon=$(omarchy-weather-icon 2>/dev/null) if [[ -n $icon ]]; then diff --git a/migrations/1778139028.sh b/migrations/1778139028.sh index e5728ced..d7bc95e1 100644 --- a/migrations/1778139028.sh +++ b/migrations/1778139028.sh @@ -6,7 +6,7 @@ WAYBAR_STYLE="$HOME/.config/waybar/style.css" if [[ -f $WAYBAR_CONFIG ]]; then if ! grep -q '"custom/weather"' "$WAYBAR_CONFIG"; then sed -i 's/"modules-center": \["clock",/"modules-center": ["clock", "custom\/weather",/' "$WAYBAR_CONFIG" - sed -i '/"network": {/i\ "custom/weather": {\n "exec": "$OMARCHY_PATH/default/waybar/weather.sh",\n "return-type": "json",\n "interval": 600,\n "tooltip": false,\n "on-click": "notify-send -u low \\"$(omarchy-weather-status)\\""\n },' "$WAYBAR_CONFIG" + sed -i '/"network": {/i\ "custom/weather": {\n "exec": "$OMARCHY_PATH/default/waybar/weather.sh",\n "return-type": "json",\n "interval": 60,\n "tooltip": false,\n "on-click": "notify-send -u low \\"$(omarchy-weather-status)\\""\n },' "$WAYBAR_CONFIG" fi fi