Repository navigation
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryWeather locations now follow the Wi-Fi network, matched by SSID and gateway address.
|
A city picked in the weather panel on Wi-Fi now holds for that network only, matched on its SSID and its gateway's hardware address; other networks auto-detect as before. A city picked off Wi-Fi, or pinned before this change, still applies everywhere else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An IPv6-only Wi-Fi network had no IPv4 default route, so its gateway was never found and every city picked there was refused. Fall back to the IPv6 gateway when there is no IPv4 one. A gateway that answered only after the panel's retries left the panel keyed on an empty gateway, so a city saved there was stored but not shown. Identify the network again after each save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isc
force-pushed
the
weather-location-per-wifi
branch
from
November 8, 2026 08:40
1c3a16b to
b6f5ee4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The weather panel finds its city from the network's IP address unless one is pinned, and IP geolocation can be far off. In a village in western France, on Free's network, the same connection is placed in Royan by
geo.omarchy.org, in La Rochelle by ipinfo, and the bar showed Chambéry this morning: 110 to 430 km away. Pinning the right city fixes that until the laptop moves: going back and forth between Paris and the countryside, either one city is pinned and wrong half the time, or nothing is pinned and the countryside is wrong all the time. #8440 asks for the same thing: keep home pinned, and auto-detect while travelling.This makes the pin follow the network. A city picked in the panel while on Wi-Fi is kept for that network, and used whenever the machine is back on it. Any other network auto-detects as it does today. Nothing new to click or translate: it is the same location field.
geo.omarchy.org, as today.weather.jsonwritten before this change, keep applying everywhere a network has no city of its own. Existing files work unchanged.How a network is recognised
A network is its SSID plus the hardware address of its default gateway, and an entry matches only when both do.
ip -j -4 route show default dev <wifi>, or-6on an IPv6-only network, and its address fromip -j neigh show <gateway>.State
weather.jsonkeeps its shape, and anetworkslist joins it. Each entry is a location like the top-level one, plus the network's SSID (kept readable for hand edits) and gateway:{ "name": "Paris", "latitude": 48.85341, "longitude": 2.3488, "networks": [ {"ssid": "Cottage", "gateway": "02:00:00:00:00:01", "name": "Lyon", "latitude": 45.74906, "longitude": 4.84789} ] }Where the location comes from:
Choices
omarchy-weather-location, which already owns the format.omarchy-weather-location --networkprints{"ssid": ..., "gateway": ...}(an empty gateway until it resolves, nothing off Wi-Fi). The panel asks it, so what the panel shows and what it saves can never be keyed differently, andomarchy-weather-status(the bar's right-click),omarchy-weather-iconand the post-boot hook report the same city as the panel without changes.Quickshell.Networking, as the network panel does, and asks for the network only when the machine joins or leaves one. It waits 1.5 s first, the startup reload's existing delay, so a brief drop doesn't flip the location back and forth, and asks again up to three times while the gateway is still unresolved.--setstores the location for this Wi-Fi network when on one, and the top-level location off Wi-Fi, which keeps the per-network entries. On a Wi-Fi network whose gateway hasn't answered yet it refuses and stores nothing; the panel then closes the editor and keeps the location it had. After a save, the panel identifies the network again, so a gateway that answered only after its retries still finds the entry just saved.--cleardoes the same. Other networks keep their entries, and the file goes away once nothing is left. The alternative, forgetting only this network's entry, would leave an older top-level pin showing and take a second click; and on a laptop that is always on Wi-Fi, there would be no way left to remove that pin from the panel.Model.js(parseNetwork, andparseLocationFilematching on SSID and gateway), next to the existing parser, with Node tests. The CLI mirrors it in jq, as it already did for the top-level location.Testing
test/shell.d/weather-test.sh: matching inModel.js(same SSID behind another gateway, same gateway under another SSID, gateway not resolved yet, off Wi-Fi), and the CLI against stubbednmcliandip(per-network--set, reading,--network, an IPv6-only network, refusing an unidentified network,--clear, removing the file). The new cases fail onquattro../test/clipasses.quattro's, with this branch's panel and command in the running shell and every request the panel made logged:geo.omarchy.orginstead;omarchy-weather-location --setrather than picked in the panel's search field, and the screen was locked during the run, so the panel's look wasn't checked; this change adds nothing to it. The IPv6 fallback and identifying the network again after a save came after that run.No visible change: the weather panel looks the same and adds no control; it reads the location stored for the current Wi-Fi network instead of a single one.
🤖 Generated with Claude Code