mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 06:15:21 +01:00
[GH-ISSUE #148] Network Manager module #2888
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#2888
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JakeStanger on GitHub (May 9, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/148
Originally assigned to: @Zedfrigg on GitHub.
Is your feature request related to a problem? Please describe.
Currently this is missing functionality that has to be scripted.
Describe the solution you'd like
A new module for managing network connections that connects to the
NetworkManagerservice. This should primarily focus on WiFi connections, but Ethernet and VPN connections are also on the table.Describe alternatives you've considered
The custom module can currently be used to achieve basic functionality but this is sub-par.
Additional context
Crate that looks hopeful for this: https://crates.io/crates/network-manager
@yavko commented on GitHub (Jun 22, 2023):
Problem is all the network manager bindings I could find use the
dbuscrate, and notzbus:/@JakeStanger commented on GitHub (Jun 22, 2023):
How much of a problem is that? Obviously pure rust is better and I'd rather avoid bringing even more deps into the mix, but if it works it works right?
@yavko commented on GitHub (Jun 22, 2023):
I'm pretty sure the
dbuscrate doesn't support async@JakeStanger commented on GitHub (Jun 22, 2023):
Not ideal, but that's okay - you can use tokio's
spawn_blockingto delegate it to its own task and avoid blocking the main thread@yavko commented on GitHub (Jun 22, 2023):
Thats true, also seems https://crates.io/crates/network-manager is only updated on the github, and not on crates.io
@JakeStanger commented on GitHub (Jun 22, 2023):
Mm yeah didn't spot that. Looks like they've been working towards libnm-rs which suffers from the same thing, and has a lot of git dependencies.
I guess that isn't a complete blocker, but I'd like to try and resolve that before this can be called complete.
@yavko commented on GitHub (Jun 22, 2023):
Is using zbus on its own hard?
@yavko commented on GitHub (Jun 22, 2023):
Forking libnm is also a possibility, seems to only use git deps because of glib, maybe a libnm-ironbar package could be published
@JakeStanger commented on GitHub (Jun 22, 2023):
From my (little) experience, it's not easy but it's not too bad. It depends a bit on the interface, but is certainly nicer than working with Wayland protocols.
Not against it. I'd rather not have to maintain another library myself if I don't have to but as a last resort, sure.
@madushan1000 commented on GitHub (Oct 13, 2023):
I noticed that you're already using Gio, Gio also has decent dbus support with async if you want to write something from scratch.
@JakeStanger commented on GitHub (Oct 13, 2023):
That's good to know, cheers :)
@JakeStanger commented on GitHub (Mar 3, 2024):
Hey @zedfrigg I've seen you've been working on a NM module in your own fork. Do you have plans to merge that into the upstream? If not, can I take that as the basis for the upstream implementation? Cheers
@Zedfrigg commented on GitHub (Mar 6, 2024):
Yes I am planning to upstream it! It does need some more work first as it doesn't handle all connection types well (e.g. VPNs), but I will continue working on it when I have the time.
@JakeStanger commented on GitHub (Mar 6, 2024):
Awesome! In that case I'll assign this issue to you. That's a big undertaking so I really appreciate it. Let me know if you need a hand, or if you're tight on time and want me to take over.
@Zedfrigg commented on GitHub (Mar 7, 2024):
Will do if needed, thanks!
@nyadiia commented on GitHub (Mar 26, 2024):
not to bump issues but what's the status on this?
@Zedfrigg commented on GitHub (Mar 27, 2024):
I unfortunately have not had the time yet to work on this further. What may be a good idea however is to upstream what I have now, and then an improved version later.
The module is functional in its current state, the icon displayed directly corresponds to the
PrimaryConnectionTypeproperty of the NetworkManager DBus API. The drawback of this is that for example if you have an active VPN connection, it is reported as the primary connection, and you have no way of knowing whether you're for example connected to a wifi network. Because of this I'm planning to rewrite this module to look at the different active connections directly, and display multiple icons for wifi, cellular, VPNs, etcetera (like e.g. Gnome or Android). Unfortunately the logic for this is non-trivial, so it will take some more time.All this brings me to a question for @JakeStanger: would you be okay with me upstreaming this over multiple PRs, one now for the minimal functionality, and more later?
@JakeStanger commented on GitHub (Mar 27, 2024):
Yes, it sounds like it's in a good enough state that we can look into merging what's there and then work on improvements. We can just open an issue for the VPN bits or leave this open, and/or a note in the docs.
It'll be a while before the next release goes out so we'll have time to test, fix, tweak etc before I'd consider it stable anyway.
The module just displays connection state at the moment and doesn't provide control (ie ability to connect to network etc) right?
@Zedfrigg commented on GitHub (Mar 30, 2024):
Great, I added a note in the module docs explaining this.
And yeah, that's correct. It's pretty bare bones at the moment, it's literally just an icon for the network state, it can't even tell you what what SSID you're connected to for example. I looked into adding this, but until the aforementioned refactor is done it'd just be a hack (see here for the details) and I'd rather not invent a square wheel first and then a round one later.
Let me know if that's acceptable. In the meantime I've opened a PR for merging what we have now.
@JakeStanger commented on GitHub (Mar 30, 2024):
I think something is better than nothing at this stage, so long as it works reliably.
It will be worth brainstorming a roadmap of sorts for this to make sure further updates stay on track and there's a finished module in site. Let me know your thoughts on that.
@Zedfrigg commented on GitHub (Aug 4, 2024):
@JakeStanger should this issue be closed now, or will we use it to track enhancements to the NM module?
@JakeStanger commented on GitHub (Aug 4, 2024):
I think we use it to track progress, as this isn't where I'd want it to be to consider it a complete module.
I'd like to see the module make nm-applet redundant, but I'd consider the following must-haves above all else:
@Rodrigodd commented on GitHub (Aug 4, 2024):
For the record, I have at least implemented WiFi Strength and icon configuration on this PR https://github.com/Zedfrigg/ironbar/pull/1, on top of another branch by @JakeStanger.