From b4d463b7948267e84d8d8031882b37c5a68baa55 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Sun, 10 May 2026 17:58:17 -0500 Subject: [PATCH 1/5] Make weather widgets location-aware `omarchy-weather-icon` and `omarchy-weather-status` now read `~/.config/omarchy/current/weather.location` when present and pass it to wttr.in. When the file is absent or empty, the URL is unchanged (`https://wttr.in?format=...`) and behavior is identical to before, so auto-detect remains the default. Adds four small CLI commands: omarchy weather location show current value omarchy weather set-location persist (city, "City, ST", or zip) omarchy weather clear-location delete the file, return to auto-detect omarchy menu weather walker prompt that calls set-location No `omarchy-menu` wiring; users can keybind `omarchy menu weather` or run it from the CLI. Spaces in locations are encoded as `+` for wttr.in. --- bin/omarchy-menu-weather | 13 +++++++++++++ bin/omarchy-weather-clear-location | 17 +++++++++++++++++ bin/omarchy-weather-icon | 5 ++++- bin/omarchy-weather-location | 12 ++++++++++++ bin/omarchy-weather-set-location | 21 +++++++++++++++++++++ bin/omarchy-weather-status | 5 ++++- 6 files changed, 71 insertions(+), 2 deletions(-) create mode 100755 bin/omarchy-menu-weather create mode 100755 bin/omarchy-weather-clear-location create mode 100755 bin/omarchy-weather-location create mode 100755 bin/omarchy-weather-set-location diff --git a/bin/omarchy-menu-weather b/bin/omarchy-menu-weather new file mode 100755 index 0000000000..89b06ebab2 --- /dev/null +++ b/bin/omarchy-menu-weather @@ -0,0 +1,13 @@ +#!/bin/bash + +# omarchy:summary=Pick a weather location via walker prompt and persist it +# omarchy:group=menu +# omarchy:examples=omarchy menu weather + +set -eo pipefail + +input=$(omarchy-menu-input "Weather location (city or zip)" || true) + +[[ -z $input ]] && exit 0 + +omarchy weather set-location "$input" diff --git a/bin/omarchy-weather-clear-location b/bin/omarchy-weather-clear-location new file mode 100755 index 0000000000..fdef8ca14f --- /dev/null +++ b/bin/omarchy-weather-clear-location @@ -0,0 +1,17 @@ +#!/bin/bash + +# omarchy:summary=Clear the configured weather location and return to auto-detect +# omarchy:examples=omarchy weather clear-location + +set -eo pipefail + +path="$HOME/.config/omarchy/current/weather.location" + +if [[ -f $path ]]; then + rm -f "$path" + echo "Weather location cleared (using auto-detect)" + echo "Restarting Waybar..." + omarchy-restart-waybar +else + echo "No weather location was configured" +fi diff --git a/bin/omarchy-weather-icon b/bin/omarchy-weather-icon index 072af7067b..17ecfc495f 100755 --- a/bin/omarchy-weather-icon +++ b/bin/omarchy-weather-icon @@ -2,7 +2,10 @@ # omarchy:summary=Returns a weather condition icon, adjusted for live sunrise and sunset. -weather_data=$(curl -fsS --max-time 3 "https://wttr.in?format=j1" 2>/dev/null | jq -er '[.current_condition[0].weatherCode, .weather[0].astronomy[0].sunrise, .weather[0].astronomy[0].sunset] | select(all(. != null and . != "")) | @tsv' 2>/dev/null) || exit 1 +loc=$(cat "$HOME/.config/omarchy/current/weather.location" 2>/dev/null || true) +loc_path="${loc:+/${loc// /+}}" + +weather_data=$(curl -fsS --max-time 3 "https://wttr.in${loc_path}?format=j1" 2>/dev/null | jq -er '[.current_condition[0].weatherCode, .weather[0].astronomy[0].sunrise, .weather[0].astronomy[0].sunset] | select(all(. != null and . != "")) | @tsv' 2>/dev/null) || exit 1 IFS=$'\t' read -r weather_code sunrise sunset <<< "$weather_data" if [[ ! $weather_code =~ ^[0-9]+$ || ! $sunrise =~ ^[0-9]{1,2}:[0-9]{2}\ [AP]M$ || ! $sunset =~ ^[0-9]{1,2}:[0-9]{2}\ [AP]M$ ]]; then diff --git a/bin/omarchy-weather-location b/bin/omarchy-weather-location new file mode 100755 index 0000000000..3b47f486e5 --- /dev/null +++ b/bin/omarchy-weather-location @@ -0,0 +1,12 @@ +#!/bin/bash + +# omarchy:summary=Show currently configured weather location +# omarchy:examples=omarchy weather location + +path="$HOME/.config/omarchy/current/weather.location" + +if [[ -f $path ]]; then + cat "$path" +else + echo "Not configured" +fi diff --git a/bin/omarchy-weather-set-location b/bin/omarchy-weather-set-location new file mode 100755 index 0000000000..8404c8cc33 --- /dev/null +++ b/bin/omarchy-weather-set-location @@ -0,0 +1,21 @@ +#!/bin/bash + +# omarchy:summary=Set the weather location used by waybar weather widgets +# omarchy:args= +# omarchy:examples=omarchy weather set-location "New York, NY" | omarchy weather set-location London | omarchy weather set-location 10001 + +set -eo pipefail + +location="$1" + +if [[ -z $location ]]; then + echo "Usage: omarchy weather set-location " >&2 + exit 1 +fi + +mkdir -p "$HOME/.config/omarchy/current" +printf '%s\n' "$location" >"$HOME/.config/omarchy/current/weather.location" + +echo "Weather location set to $location" +echo "Restarting Waybar..." +omarchy-restart-waybar diff --git a/bin/omarchy-weather-status b/bin/omarchy-weather-status index b2552b82e6..a1da8ae5a5 100755 --- a/bin/omarchy-weather-status +++ b/bin/omarchy-weather-status @@ -2,7 +2,10 @@ # omarchy:summary=Returns a formatted weather status string with temperature and wind speed. -weather=$(curl -fsS --max-time 4 "https://wttr.in?format=%l|%t|%w" 2>/dev/null | tr -d '\n') +loc=$(cat "$HOME/.config/omarchy/current/weather.location" 2>/dev/null || true) +loc_path="${loc:+/${loc// /+}}" + +weather=$(curl -fsS --max-time 4 "https://wttr.in${loc_path}?format=%l|%t|%w" 2>/dev/null | tr -d '\n') if [[ -z $weather ]]; then echo "Weather unavailable" From 005be4679003d587d337cf68a722cb0ab5ae2852 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Mon, 11 May 2026 21:16:40 -0500 Subject: [PATCH 2/5] Add weather location to setup menu Menu structure based on #5714 by NjengaFelix. Co-Authored-By: Felix Njenga <32095327+NjengaFelix@users.noreply.github.com> --- bin/omarchy-menu | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-menu b/bin/omarchy-menu index d9583ec87e..ad31431ef9 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -334,7 +334,7 @@ show_font_menu() { } show_setup_menu() { - local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors" + local options=" Audio\n Wifi\n󰂯 Bluetooth\n󰖙 Weather\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors" [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings" [[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input" options="$options\n Defaults\n󰱔 DNS\n Security\n Config" @@ -343,6 +343,7 @@ show_setup_menu() { *Audio*) omarchy-launch-audio ;; *Wifi*) omarchy-launch-wifi ;; *Bluetooth*) omarchy-launch-bluetooth ;; + *Weather*) show_setup_weather_menu ;; *Power*) show_setup_power_menu ;; *System*) show_setup_system_menu ;; *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;; @@ -356,6 +357,13 @@ show_setup_menu() { esac } +show_setup_weather_menu() { + case $(menu "Weather" "󰖙 Location") in + *Location*) omarchy-menu-weather ;; + *) show_setup_menu ;; + esac +} + show_setup_power_menu() { profile=$(menu "Power Profile" "$(omarchy-powerprofiles-list)" "" "$(powerprofilesctl get)") From 4835afdee57cc731e6963c0e2e0940a43383fe71 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Thu, 14 May 2026 14:04:30 -0500 Subject: [PATCH 3/5] Make weather widgets units-aware --- bin/omarchy-menu-weather-units | 17 +++++++++++++++++ bin/omarchy-weather-clear-units | 17 +++++++++++++++++ bin/omarchy-weather-icon | 9 ++++++++- bin/omarchy-weather-set-units | 26 ++++++++++++++++++++++++++ bin/omarchy-weather-status | 9 ++++++++- bin/omarchy-weather-units | 12 ++++++++++++ 6 files changed, 88 insertions(+), 2 deletions(-) create mode 100755 bin/omarchy-menu-weather-units create mode 100755 bin/omarchy-weather-clear-units create mode 100755 bin/omarchy-weather-set-units create mode 100755 bin/omarchy-weather-units diff --git a/bin/omarchy-menu-weather-units b/bin/omarchy-menu-weather-units new file mode 100755 index 0000000000..3170da924b --- /dev/null +++ b/bin/omarchy-menu-weather-units @@ -0,0 +1,17 @@ +#!/bin/bash + +# omarchy:summary=Pick weather units via walker prompt and persist them +# omarchy:group=menu +# omarchy:examples=omarchy menu weather-units + +set -eo pipefail + +choice=$(omarchy-menu-select "Weather units" "Metric" "Imperial" "Auto-detect" || true) + +[[ -z $choice ]] && exit 0 + +case $choice in + Metric) omarchy weather set-units metric ;; + Imperial) omarchy weather set-units imperial ;; + Auto-detect) omarchy weather clear-units ;; +esac diff --git a/bin/omarchy-weather-clear-units b/bin/omarchy-weather-clear-units new file mode 100755 index 0000000000..0299fc3974 --- /dev/null +++ b/bin/omarchy-weather-clear-units @@ -0,0 +1,17 @@ +#!/bin/bash + +# omarchy:summary=Clear the configured weather units and return to auto-detect +# omarchy:examples=omarchy weather clear-units + +set -eo pipefail + +path="$HOME/.config/omarchy/current/weather.units" + +if [[ -f $path ]]; then + rm -f "$path" + echo "Weather units cleared (using auto-detect)" + echo "Restarting Waybar..." + omarchy-restart-waybar +else + echo "No weather units were configured" +fi diff --git a/bin/omarchy-weather-icon b/bin/omarchy-weather-icon index 17ecfc495f..13e1237ece 100755 --- a/bin/omarchy-weather-icon +++ b/bin/omarchy-weather-icon @@ -5,7 +5,14 @@ loc=$(cat "$HOME/.config/omarchy/current/weather.location" 2>/dev/null || true) loc_path="${loc:+/${loc// /+}}" -weather_data=$(curl -fsS --max-time 3 "https://wttr.in${loc_path}?format=j1" 2>/dev/null | jq -er '[.current_condition[0].weatherCode, .weather[0].astronomy[0].sunrise, .weather[0].astronomy[0].sunset] | select(all(. != null and . != "")) | @tsv' 2>/dev/null) || exit 1 +units=$(cat "$HOME/.config/omarchy/current/weather.units" 2>/dev/null || true) +case $units in + metric) units_param="&m" ;; + imperial) units_param="&u" ;; + *) units_param="" ;; +esac + +weather_data=$(curl -fsS --max-time 3 "https://wttr.in${loc_path}?format=j1${units_param}" 2>/dev/null | jq -er '[.current_condition[0].weatherCode, .weather[0].astronomy[0].sunrise, .weather[0].astronomy[0].sunset] | select(all(. != null and . != "")) | @tsv' 2>/dev/null) || exit 1 IFS=$'\t' read -r weather_code sunrise sunset <<< "$weather_data" if [[ ! $weather_code =~ ^[0-9]+$ || ! $sunrise =~ ^[0-9]{1,2}:[0-9]{2}\ [AP]M$ || ! $sunset =~ ^[0-9]{1,2}:[0-9]{2}\ [AP]M$ ]]; then diff --git a/bin/omarchy-weather-set-units b/bin/omarchy-weather-set-units new file mode 100755 index 0000000000..b2ed584ea4 --- /dev/null +++ b/bin/omarchy-weather-set-units @@ -0,0 +1,26 @@ +#!/bin/bash + +# omarchy:summary=Set the weather units used by waybar weather widgets +# omarchy:args= +# omarchy:examples=omarchy weather set-units metric | omarchy weather set-units imperial + +set -eo pipefail + +units="$1" + +if [[ -z $units ]]; then + echo "Usage: omarchy weather set-units " >&2 + exit 1 +fi + +if [[ $units != "metric" && $units != "imperial" ]]; then + echo "Invalid units: $units (must be metric or imperial)" >&2 + exit 1 +fi + +mkdir -p "$HOME/.config/omarchy/current" +printf '%s\n' "$units" >"$HOME/.config/omarchy/current/weather.units" + +echo "Weather units set to $units" +echo "Restarting Waybar..." +omarchy-restart-waybar diff --git a/bin/omarchy-weather-status b/bin/omarchy-weather-status index a1da8ae5a5..306fa5c77c 100755 --- a/bin/omarchy-weather-status +++ b/bin/omarchy-weather-status @@ -5,7 +5,14 @@ loc=$(cat "$HOME/.config/omarchy/current/weather.location" 2>/dev/null || true) loc_path="${loc:+/${loc// /+}}" -weather=$(curl -fsS --max-time 4 "https://wttr.in${loc_path}?format=%l|%t|%w" 2>/dev/null | tr -d '\n') +units=$(cat "$HOME/.config/omarchy/current/weather.units" 2>/dev/null || true) +case $units in + metric) units_param="&m" ;; + imperial) units_param="&u" ;; + *) units_param="" ;; +esac + +weather=$(curl -fsS --max-time 4 "https://wttr.in${loc_path}?format=%l|%t|%w${units_param}" 2>/dev/null | tr -d '\n') if [[ -z $weather ]]; then echo "Weather unavailable" diff --git a/bin/omarchy-weather-units b/bin/omarchy-weather-units new file mode 100755 index 0000000000..bd96360cbe --- /dev/null +++ b/bin/omarchy-weather-units @@ -0,0 +1,12 @@ +#!/bin/bash + +# omarchy:summary=Show currently configured weather units +# omarchy:examples=omarchy weather units + +path="$HOME/.config/omarchy/current/weather.units" + +if [[ -f $path ]]; then + cat "$path" +else + echo "Auto-detect" +fi From 85621711e4fa212e398e921757e9d937d89e8588 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Thu, 14 May 2026 14:04:33 -0500 Subject: [PATCH 4/5] Add weather units to setup menu --- bin/omarchy-menu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-menu b/bin/omarchy-menu index ad31431ef9..34933f617a 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -358,8 +358,9 @@ show_setup_menu() { } show_setup_weather_menu() { - case $(menu "Weather" "󰖙 Location") in + case $(menu "Weather" "󰖙 Location\n Units") in *Location*) omarchy-menu-weather ;; + *Units*) omarchy-menu-weather-units ;; *) show_setup_menu ;; esac } From 1b21ff21feafca6403d99d6ed2b659fa95332ea8 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Thu, 14 May 2026 14:20:15 -0500 Subject: [PATCH 5/5] Expose Weather submenu via omarchy-menu dispatcher Wires `omarchy-menu weather` to open the Weather setup submenu (Location, Units) so it can be bound to waybar's right-click handler. --- bin/omarchy-menu | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 34933f617a..563f33b901 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -899,6 +899,7 @@ go_to_menu() { *theme*) show_theme_menu ;; *screenrecord*) show_screenrecord_menu ;; *setup*) show_setup_menu ;; + *weather*) show_setup_weather_menu ;; *power*) show_setup_power_menu ;; *install*) show_install_menu ;; *remove*) show_remove_menu ;;