Repository navigation
Show Wi-Fi in the bar when a wired link has no internet route - #606
Merged
Merged
Conversation
A Thunderbolt bridge (auto link-local or a never-default static profile) is a connected wired device without the default route, so the bar showed Ethernet, red whenever connectivity dipped, while Wi-Fi carried the internet. The bar now asks which interface owns the internet route and lets Wi-Fi win only when that route leaves via Wi-Fi.
The internet-route lookup missed VPNs and route moves that leave every device connected. NetworkManager's primary connection names the physical link (the VPN endpoint's when a VPN owns the route), and nmcli monitor reports when it moves, so the bar re-checks on those events too.
This was referenced Sep 27, 2026
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 bar's network pill picked Ethernet whenever any wired device was connected. On Macs,
thunderbolt0(a Thunderbolt bridge to another computer, with NM's auto link-local profile or a static never-default one) is connected but never carries the internet, so the M2 showed the Ethernet glyph, red whenever connectivity dipped, while Wi-Fi had the default route. NM connectivity itself was full and the check URL is configured; the pill just never asked which link is primary.omarchy-network-status --primary-deviceprints the interface of NetworkManager's primary connection (the default-route link, or the link to the VPN endpoint when a VPN owns the route).nmcli monitorevent (restarted if it exits), debounced. Wi-Fi wins only when it is the primary; wired-primary and unknown-primary keep the old wired preference, so x86/Snapdragon with wired internet are unchanged.no-auto-defaultfor thunderbolt was not used: it would miss static profiles and drop zero-config Thunderbolt networking.Tested:
test/shell.d/network-test.sh(newbarKindtable, panel wiring, script with a stubbedbusctl),network-captive-portal-test.shwith a new runtime scenario (Thunderbolt link up while Wi-Fi is primary; primary moved by a monitor event alone, both directions; monitor restart), run under a real compositor on the M1 Pro: pass; removing the device trigger, the monitor trigger or the restart each makes it fail. CI has no compositor, so it skips that part. Script on the M2 printswlan0. Bar check on the M2 is in ticket 97.Design debated before settling (route lookup → primary connection + event trigger; restart kept outside a binding). Second review: no bugs; one test gap fixed.