Skip to content

fix(network): network device hot-plugging#449

Open
ScarsTRF wants to merge 4 commits into
Aylur:mainfrom
ScarsTRF:nm-hotplug-fix
Open

fix(network): network device hot-plugging#449
ScarsTRF wants to merge 4 commits into
Aylur:mainfrom
ScarsTRF:nm-hotplug-fix

Conversation

@ScarsTRF

@ScarsTRF ScarsTRF commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Fixes NetworkManager device not updating after hot-pluggin a network device in AstalNetwork.

Previously, Network.wifi and Network.wired were only populated during initialization. Starting AGS/Astal before plugging in a USB Ethernet adapter or USB WiFi adapter and would leave the corresponding device object as null.

This updates the network module to refresh the relevant device wrapper when NetworkManager reports a device add/remove event. Wired-only events only refresh wired state, and WiFi-only events only refresh WiFi state.

This also keeps Network.wifi and Network.wired as stable wrapper objects instead of setting them to null when their device is missing making it easier for users to keep their bindings active if a device is removed or changed.

This also adds is_active to Wifi and Wired so users can check if the device is present on NetworkManager.

Verification

  • nix build .#network builds Astal fully.
  • Tested on a Framework Laptop by launching AGS before and after plugging/un-plugging an Ethernet card.
  • Confirmed Network.wired/wifi.is_active updates from false to true after plugging in a Ethernet card.
  • Confirmed unplug/replug works without NetworkManager or Astal critical warnings.

ScarsTRF added 4 commits June 2, 2026 15:32
This is especially an issue with laptop devices such as a framework laptop with the ethernet card.
This should prevent any signals or devices from being touched on device add/remove.
Keep Network.wifi and Network.wired as stable wrapper objects instead of
setting them to null when their backing NetworkManager device is missing.

Add is_active to Wifi and Wired so users can tell whether the wrapper
currently has a backing device while still binding to stable properties like
icon-name.
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

@ScarsTRF is attempting to deploy a commit to the aylur's projects Team on Vercel.

A member of the Team first needs to authorize it.

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