added more advance weather capabilities

This commit is contained in:
2026-09-13 00:25:32 -06:00
parent dabda20dae
commit dd7868e732
4 changed files with 42 additions and 19 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Open the hourly weather forecast (wttr.in v2 view) in a ghostty window;
# focus it if it is already open. Intended as the on-click action for the
# waybar weather module.
set -uo pipefail
if hyprctl clients -j 2>/dev/null | jq -e 'any(.[]; ((.title // "") + " " + (.class // "")) | ascii_downcase | contains("wttr"))' >/dev/null 2>&1; then
hyprctl dispatch 'hl.dsp.focus({ window = "title:wttr" })' 2>/dev/null || true
exit 0
fi
CITY="${WEATHER_CITY:-Denver}"
ghostty --title=wttr -e bash -c 'curl -fsS --max-time 15 "https://v2.wttr.in/'"${CITY}"'"; printf "\n"; read -r -p "Press Enter to close"' &
disown