JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
486 stars 36 forks source link

[Tray] iwgtk indicator fails to display and errors out ironbar #645

Open JonasVerhofste opened 2 weeks ago

JonasVerhofste commented 2 weeks ago

Describe the bug When running iwgtk with indicator support, ironbar does not show the tray icon and throws an error. I'm pretty sure this is unrelated to other tray-related issues, as other tray applications work fine. Running with IRONBAR_LOG=debug gives me the following relevant output:

2024-06-20T23:41:31.183938Z DEBUG dispatch_message{msg=Msg { type: MethodCall, sender: UniqueName(Str(Borrowed(":1.172"))), path: ObjectPath("/StatusNotifierWatcher"), iface: InterfaceName(Str(Borrowed("org.kde.StatusNotifierWatcher"))), member: MemberName(Str(Borrowed("RegisterStatusNotifierItem"))), body: Signature("s") }}:dispatch_method_call{msg=Msg { type: MethodCall, sender: UniqueName(Str(Borrowed(":1.172"))), path: ObjectPath("/StatusNotifierWatcher"), iface: InterfaceName(Str(Borrowed("org.kde.StatusNotifierWatcher"))), member: MemberName(Str(Borrowed("RegisterStatusNotifierItem"))), body: Signature("s") }}:dispatch_method_call_try{msg=Msg { type: MethodCall, sender: UniqueName(Str(Borrowed(":1.172"))), path: ObjectPath("/StatusNotifierWatcher"), iface: InterfaceName(Str(Borrowed("org.kde.StatusNotifierWatcher"))), member: MemberName(Str(Borrowed("RegisterStatusNotifierItem"))), body: Signature("s") }}: system_tray::dbus::status_notifier_watcher: 73: registered item: org.kde.StatusNotifierItem-29555-1 | :1.172
2024-06-20T23:41:31.184169Z DEBUG system_tray::client: 127: received new item: :1.172org.kde.StatusNotifierItem-29555-1
2024-06-20T23:41:31.184358Z ERROR system_tray::client: 240: Error fetching properties from :1.172org.kde.StatusNotifierItem-29555-1/StatusNotifierItem: ServiceUnknown("The name is not activatable")

As far as I understand it (and I could be horribly wrong), the StatusNotifierItem API that is mentioned in the iwgtk README, is the freedesktop standard that the kde libappindicator protocol implements? So in theory, iwgtk and ironbar should be compatible? However, I'm not sure if the above problem here lies with ironbar, a library used by ironbar or the way iwgtk advertises itself. In case of the latter two I'll create issues in the relevant repo and this can be closed.

To Reproduce

Expected behavior The iwgtk icon shows up in the tray

System information:

JakeStanger commented 1 week ago

However, I'm not sure if the above problem here lies with ironbar, a library used by ironbar or the way iwgtk advertises itself. In case of the latter two I'll create issues in the relevant repo and this can be closed.

I've not investigated yet, but here's what I do know:

My litmus test tends to be "does it work properly in another tray impl?" For example, all of Waybar, AGS and Quickshell have more correct implementations. A tray icon's behaviour there will confirm whether it's Ironbar or not.

JonasVerhofste commented 1 week ago

Installed waybar to test and can confirm that it seems to work properly there (including changing icon images depending on wifi state). So that sadly increases the odds of it being ironbar.

I'll see if I can figure out where exactly it goes wrong. My brain however doesn't fully agree with rust (yet), so it'll take a bit for my head to wrap around the issue.

JakeStanger commented 1 week ago

No worries if you can't get anywhere, it's not an easy task. If you do want to give it a go though, the tray impl is here: https://github.com/JakeStanger/system-tray

JonasVerhofste commented 1 week ago

Aha, that's what I was missing! Not being used to the rust ecosystem I had not seen that the implementation lived elsewhere. You want me to close this issue and create one there?

JakeStanger commented 1 week ago

Happy to keep it here