-
Notifications
You must be signed in to change notification settings - Fork 164
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
trayicon: migrate from libappindicator to org.kde.StatusNotifierItem #558
trayicon: migrate from libappindicator to org.kde.StatusNotifierItem #558
Conversation
beeae86
to
e8ad460
Compare
I tested this in Linux Mint 22 (based on Ubuntu 24.04). The tray icon is there, but it opens an empty menu. There is no error message in terminal. Am I missing some dependencies? Note: I tested the branch https://github.com/deltragon/SafeEyes/tree/trayicon-statusnotifier, without merging the gtk4 branch into it. |
Oh, that is interesting. I'll have to look into that. |
AFAIK, Cinnamon desktop does not use extensions to display tray icons. It does so natively for both GTK and Qt apps. GNOME extensions are not compatible with Cinnamon |
I tried after installing |
Oh, that's Cinnamon, makes sense. (I mistook it for GNOME) |
Hmm. Ideally we would like SafeEyes to work everywhere (GNOME/KDE/XFCE/MATE/Cinnamon/LXDE....) out of the box, so we need more testers to let us know how it is working. |
I'm considering if I can add back support for libappindicator here, similar to how the smartpause plugin also supports xprintidle/swayidle/etc... that might be the safest option here. |
Marking this as draft until I have a chance to look into that. |
2f723c9
to
0ade3bf
Compare
@deltragon Please ping me once you think it is ready. |
Okay, so coming back to this: The issue on Cinnamon had been that, well, it's not actually a standard - while there is org.freedesktop.StatusNotifierItem, nobody actually uses that - everyone uses the KDE version, or specifically, the version that libappindicator/libayatana-appindicator implemented, which have actually diverged quite a bit. (Same story with org.canonical.dbusmenu.) The only downside I see is that we have another bespoke implementation of the SNI "spec", with all the maintenance effort that brings. However, if we want a Gtk4 port with a working status icon, we will have to have that maintenance effort in some way or another, as there is no other implementation that fits our needs, nor a competing standard to SNI that is widely implemented. In short, I have fixed the implementation, and tested it on all major DEs. In my opinion, this is ready to merge. |
Thank you very much! I will test it soon.
I don't want to argue about benefits of GTK3 vs GTK4, but, GTK3 is not going away anytime soon. Gimp3 depends on GTK3, and it is not even released yet. Also, the Linux Mint team is planning to continue working with GTK3 as it has better compatibility outside GNOME desktop. I am sure it will be supported for another 10 years or so... However, since you have already implemented an alternative, sticking to GTK3 is not anymore necessary :)
Given you have already implemented it, why do you think that it will require extra maintenance effort in future? |
@archisman-panigrahi Yeah, that's a fair argument. I was gonna say that I wanted Gtk4 for its better wayland support, and specifically for #576 - however, I just realized that that PR doesn't actually need Gtk4 anymore... so I've marked it ready for review :) I don't see much maintenance effort in the future, assuming that things stay as they are, and the SNI implementations don't change much. It might be that we see a similar issue like with Cinnamon at some point, however, where maybe KDE decides that they now expect implementations to provide more methods. |
Works in Cinnamon in Linux Mint 22 beta. Also, both left and right click works (unlike what you found in LXQt). So far, so good. I will test this in LXDE/Openbox (Raspberry Pi OS - which has millions of users), and merge it. |
c0d077f
to
1b777e3
Compare
Question: Suppose they disable the trayicon plugin, and run safeeyes from command line. How can they enable the plugin ever again? One cannot open settings without the tray icon. I suggest this "Disable plugin" happens only in that session, and the error is again shown the next time safe eyes is run. If someone needs to stop showing the error, they will have to run safe eyes with a different argument ( (I hope you are not getting impatient by my comments, I respect your skills and patience to listen to my comments, I just want to ensure the best user experience of Safe Eyes before merging this). |
Great! I will test this in my LXDE setup in a day or two. |
Before merging, I want to test this in the following.
In Pantheon the current master branch of safe eyes runs without a tray icon, without any warning. https://github.com/deltragon/SafeEyes/tree/trayicon-statusnotifier shows the following error. If I install snixembed, no icon is shown. But safeeyes runs in the background without any warning, and asks me to blink my eyes, etc. After further checking I discovered that apps like telegram or ktorrent run without showing any tray icons.
|
The image for the error in Pantheon does not load for me. |
I did find these plugins for Pantheon: |
Works after installing Wingpanel Indicator. I updated the wiki for Pantheon. BTW, in Elementary OS 7, I do get the GUI warning that tray icon is not working when Wingpanel indicator is not running (needs to be added to startup applications). (I am considering moving to elementaryOS, it is so beautiful!). I will just test in Raspberry Pi later today, and merge. |
add option to disable errored plugin
bd501fa
to
239bb99
Compare
Thank you so much! |
This is necessary for migrating to gtk4, as gtk4 does not support libappindicator (neither the gtk nor ayatana version, see AyatanaIndicators/libayatana-appindicator#22).
The org.kde.StatusNotifierItem is non-standard, however it seems more likely to be a way forward than libappindicator.
See also https://pagure.io/fedora-workstation/issue/246 for a discussion on this.
For example, this should also work on default ubuntu desktop installs, with GNOME using https://github.com/ubuntu/gnome-shell-extension-appindicator.
Unfortunately, since it is not standardized yet, there is no python library for using it, so this PR needs to create its own bespoke implementation of the DBus interactions.
Additionally, this also drops dbus-python in favor of Gio's dbus.
This is tested in KDE Plasma 5.27, Plasma 6, and GNOME 46 with the extension.