Skip to content

Show Wi-Fi in the bar when a wired link has no internet route - #606

Merged
maralcbr merged 4 commits into
quattro-upstreamfrom
mac/97-wifi-icon-limited
Sep 27, 2026
Merged

maralcbr merged 4 commits into
quattro-upstreamfrom
mac/97-wifi-icon-limited

Conversation

@maralcbr

@maralcbr maralcbr commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

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-device prints the interface of NetworkManager's primary connection (the default-route link, or the link to the VPN endpoint when a VPN owns the route).
  • The panel looks it up at startup, on device/connectivity changes, and on every nmcli monitor event (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-default for thunderbolt was not used: it would miss static profiles and drop zero-config Thunderbolt networking.

Tested: test/shell.d/network-test.sh (new barKind table, panel wiring, script with a stubbed busctl), network-captive-portal-test.sh with 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 prints wlan0. 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.

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.
@maralcbr
maralcbr merged commit 66bb96f into quattro-upstream Sep 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant