Skip to content

Quickshell.Network NetworkManager backend #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

cpwrs
Copy link

@cpwrs cpwrs commented Jul 6, 2025

Network service and NetworkManager backend.

Just the basics to:

  • Turn wifi switch on/off
  • List wifi devices (address, name, state) and set a default
  • List wifi networks (ssid, security, signal strength, known connection settings)
  • Attempt a network connection

@outfoxxed
Copy link
Member

Why are we linking nm? Should be entirely over dbus

cpwrs added 7 commits July 9, 2025 14:57
NMWireless will be a property of Device (if DeviceType==Wifi). In the
future if many org.freedesktop.networkmanager.Device.* are implemented,
we can use the factory pattern to create an NMDevice with its subdevice
properties and methods.
@outfoxxed
Copy link
Member

I'm not sure what stage of development you're at here and haven't checked code yet, but just so we're clear I'd like to expose this under Quickshell.Network and keep the API clean of NM specific things (an IWD backend has been requested as well).

I don't think I've made that clear so far. (If you've got any questions, @ me here or in the matrix/discord)

@outfoxxed outfoxxed force-pushed the master branch 2 times, most recently from 9d41148 to 4b35d7b Compare July 10, 2025 08:51
@cpwrs cpwrs changed the title NetworkManager Service Quickshell.Network NetworkManager backend Jul 11, 2025
@outfoxxed outfoxxed force-pushed the master branch 2 times, most recently from 525a933 to bb206e3 Compare July 13, 2025 05:02
cpwrs added 12 commits July 15, 2025 11:49
Access point objects shouldn't be provided to the user. Instead, we
should expose WifiNetworks which represent a set of APs with the same
SSID. A WifiNetwork signal represents the maximum signal of its APs.
LastScan is still relevant to the NetworkManager backend to set the
scanning state to false (completed), but doesn't need to be exposed to
the frontend and isn't available in other backends
Added adapters to the Settings and Settings.Connections NetworkManager
interfaces. Fixed the NetworkBackend constructor to wait for the ready
status of each backend before trying the next.
Adds NMWirelessManager which merges identical NMWirelessNetworks (groups
of APs with the same SSID) and NMConnectionAdapters (saved connection
settings to wifi networks), and creates WifiNetworks on the frontend.
The manager takes a similar approach to plasma-nm and nm-applet. Adds
utilities to determine a connections security type and a networks best
choice for security, in sync with nm_utils_security_valid from nmcli.
@domenkozar
Copy link

Really looking forward to this one! :)

Removes the NMWirelessManager and moves its functionality to the
NMWirelessDevice, which now extends NMDevice. NMWirelessNetworks hold
all of the state of the APs and connections and signals the best
settings for connection.
@cpwrs cpwrs marked this pull request as ready for review August 19, 2025 00:16
@cpwrs
Copy link
Author

cpwrs commented Aug 19, 2025

Still missing a secret agent for networks that require passwords. I've tested with nm-applet as the agent and everything seems to work.

I completely separated the frontend and backend objects, with some nm-specific members in the frontend. Happy to do multi-backend in a different style though.

I think this is enough features (+ agent) for most WiFi use cases, but there's a ton more functionality to add in the future:

  • Connection manager
  • VPN connections
  • Wired/ethernet
  • Device speed

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.

3 participants