Skip to content

feat(wifi): keep showing Wi-Fi while a VPN is connected - #1207

Open
JanDeDobbeleer wants to merge 1 commit into
amnweb:mainfrom
JanDeDobbeleer:feat/wifi-vpn-aware
Open

JanDeDobbeleer wants to merge 1 commit into
amnweb:mainfrom
JanDeDobbeleer:feat/wifi-vpn-aware

Conversation

@JanDeDobbeleer

Copy link
Copy Markdown
Contributor

Problem

When a VPN is connected (tested with ProtonVPN/WireGuard), Windows makes the VPN adapter the internet connection profile. The Wi-Fi widget treats every non-WLAN internet profile as Ethernet, so it switches to the Ethernet icon while the machine is still on Wi-Fi. The worker also took the name from the first profile with internet access, which is the VPN, so {wifi_name} showed ProtonVPN.

Fix

  • The worker now snapshots the online connection profiles once per poll and classifies them in a pure classify_connections function. VPN adapters are recognised by IANA interface type (23 PPP, 53 proprietary virtual, 131 tunnel). Under a VPN, the Wi-Fi or Ethernet profile carrying it decides the icon, name and signal bars.
  • WiFiInfo gains ethernet and vpn_name, so the widget no longer calls WinRT on the UI thread to decide between Wi-Fi and Ethernet.
  • New {vpn_icon} and {vpn_name} placeholders and a vpn_icon option. Label parts that format to nothing are hidden, so a VPN badge only takes space while a VPN is connected:
label: '<span>{wifi_icon}</span><span class="vpn">{vpn_icon}</span>'
  • Docs updated with the option, placeholders and a VPN section.

Testing

  • New tests/widgets/test_wifi.py: VPN over Wi-Fi, VPN over Ethernet, Wi-Fi, Ethernet preferred over Wi-Fi, offline, and the badge showing only while a VPN is connected.
  • ruff check / ruff format clean, pyright clean on the changed files, full test suite passes.
  • Running in a local build on Windows 11 ARM64: Wi-Fi icon and signal stay correct with ProtonVPN connected, and the badge disappears when it disconnects.

A connected VPN becomes the internet connection profile, so the widget showed
the Ethernet icon and the worker could report the VPN as the Wi-Fi name. The
worker now classifies the online profiles once per poll, looks up the Wi-Fi or
Ethernet connection under a VPN, and the widget no longer calls WinRT on the UI
thread.

Adds {vpn_icon} and {vpn_name} label placeholders and a vpn_icon option. Label
parts that format to nothing are hidden, so a VPN badge only shows while a VPN
is connected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@amnweb

amnweb commented Oct 28, 2026

Copy link
Copy Markdown
Owner

@JanDeDobbeleer Thanks for the PR, but let's wait a little bit because we've started working on moving YASB to Qt Quick, which will change pretty much everything. All the old code, documentation, and so on will be replaced. Once we fully switch over, there won't be the same limitations on how you can create widgets, plugins, bars, and more.

Here are just a few examples of where we are now.

2026-10-28.01-11-26_2.mp4

And here's an example of how you can group everything inside your own QML file, with three widgets and services all running under one roof.

2026-10-28.04-04-08.mp4

And there's also a lot of other cool stuff already committed or planned. You'll be able to create your own widgets without needing to open a pull request, because your custom widgets will live directly inside your config folder. So, with all that in mind, let's keep this PR open for now. But to avoid feature requests and having to rewrite services, let's wait a little until we finish everything on our side.

@JanDeDobbeleer

Copy link
Copy Markdown
Contributor Author

Cool! Thanks for sharing, I'll keep my own build in the meantime in that case.

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.

2 participants