-
Notifications
You must be signed in to change notification settings - Fork 22
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
Systray linux support #20
Comments
Yes, it's a nice feature, makes my life much easier to see into which folders all the new e-mails were moved via a filter. Looking at our code
we only add Do you get any unread counts anywhere in KDE? I guess they have a thing that looks like the Windows systray. Could you supply a screenshot? If there is an unread count, I could add the tooltip there as well. Would you be willing to try out a corrected version? |
Sorry, updateUnreadCount() does nothing on Linux: |
There isn't any systray on Linux, on Thunderbird too. Gotta use something like BirdTray or Systray-x but both kinda suck. |
Well, I guess the problem is, that there isn't one Linux, but there are many, and they use many desktops. On Mint, there is a systray: |
Actually, if I don't work on Betterbird, I work for a company that has a product that puts something into the Linux systray. Let me find out how they do it. No promised made, this doesn't look so good: https://islinuxabout.xyz/systray/ |
OK, I found it. Our product uses libappindicator with calls like app_indicator_new(), app_indicator_set_status/label/title() and also Gtk calls like gtk_menu_new(), etc. There's even some sample code on how to drive this: |
Amazing! Seems promising! I'll maybe research alittle later too. I know Gnome dropped their systray I think but they have addons to bring it back. Think kde and gnome would be the big ones to test on. Maybe xfce too (and any others people can chime in). I can help test and debug any code, littlw code review too even though the code is more unfamiliar territory for me. |
I managed to compile the sample code and yes, it displays an icon in the "systray" (seems to be called application indicator area(?)). I'll tweak it a bit later today and give you a test program to see whether you get the icon. If that works, it can be integrated into Betterbird. |
Putting up an icon was easy enough |
This stuff is really painful 👎.
|
@Betterbird Excellent work. Painful, hopefully there is a way. KDE's implementation is more straight forward: https://api.kde.org/frameworks/knotifications/html/classKStatusNotifierItem.html |
"Excellent work", no result 😢 I think this needs to be written in terms of dbus/Gtk, like Mozilla code does already a bit: BTW, when I said "Mint", I was talking about my XFCE desktop on Mint. It would be good if we could locate the source code of the Notification, Update, Network, Volume Control and Clock widgets, all of which display a tooltip. The other option would be to drill this open: https://sources.debian.org/src/libayatana-appindicator/. The whole thing is so sad, since this (real screenshot, no mock-up) can be done with little code, cutting out the menu and putting the tooltip directly on the icon requires days of development: |
@hockeymikey: Try this on KDE, does it work? You need to extract the PNG next to the executable. |
Through a contact with @sunweaver finally found https://github.com/AyatanaIndicators/libayatana-appindicator and AyatanaIndicators/libayatana-appindicator#17 where tooltips have been added; what a coincidence. I'll check it out. |
@Betterbird What am I supposed to do with the zip? Build it and then what? |
@hockeymikey : Run the executable betterbird-systray-icon. If you don't trust it, you can compile it yourself, source code and Makefile supplied. You need to unzip the PNG into the same directory. From what I've read, you should see the app icon in the systray/panel. I'm working on getting a version with the tooltip in the right spot, and then integrating that in to Betterbird. |
OK, so KDE does show the title from |
Sorry, hover the menu item. How does the tooltip look like? See #20 (comment) for how it looks for me. |
@hockeymikey: Here's the next one to try. No menu, just the desired tooltip. Works (badly) on Mint XFCE: AyatanaIndicators/libayatana-appindicator#17 (comment) Here's the archive, executable plus source/makefile: |
@Betterbird That second one does nothing for me. |
Well, the second one is the one that should display the tooltip. Apparently on Kubuntu it works half-way if you run it as So far I haven't see a stable solution, so let's see how AyatanaIndicators/libayatana-appindicator#17 works out. The whole thing goes onto the back burner. |
The only stable solution I've found so far for Linux is https://github.com/gyunaev/birdtray. You can configure it to use Betterbird. Manjaro 21.2.1 |
Thanks for the comment, but that's a lot of code and - dare a say - quite some over-engineering (quote: Birdtray checks the unread e-mail status directly by reading the Thunderbird email mork database). The information is there in TB/BB, we just need to display it in the systray which should essentially be <10 lines of code, see AyatanaIndicators/libayatana-appindicator#17 (comment). |
Which is absolutely correct I guess! I'd love having it in Betterbird natively and kick that one out! Just wanted to share it with everyone who's searching for a solution which is working out at the time being. |
Here's another test program which simulates the full Betterbird function. It updates icons, title and tooltip. I guess it makes no difference on GNOME which doesn't show any text, and it won't make a difference on KDE which displays the title. It does make a difference on one of our Minx/Xfce systems since this now shows a text to go with the icon when hovered. |
@hockeymikey @Zahrun @Posi81 @mfschumann : Could you try the test programs from the previous comment and this comment #20 (comment) again on KDE. With and without root. Hover the icon after each change to see whether the text updates. |
I don't have KDE available, so I have only tested the demos under Gnome and Xfce. The behavior is pretty consistent, the only exception being that Gnome does not show tooltips (this is to be expected as per this comment on the gnome-shell-extension-appindicator repo). The tooltips shown on Xfce do update as intended. Here are my full results:
|
Wow. Thanks! I'd love to see a table like this for KDE. So BB (https://www.betterbird.eu/downloads/LinuxArchive/betterbird-102.7.0-preview.en-US.linux-x86_64.tar.bz2) run as root on Xubuntu/Xfce behaves the same as the last line in the table, right? |
Yes, this BB version run as root on Xfce shows the icon when new mail arrives and updates the tooltip when more mail arrives. Is there any idea on how to get rid of the run-as-root requirement? I don't think it is a good idea to recommend running BB (or any GUI app) as root. |
Here's our table:
I expect that KDE users will report that the tooltip is actually the title "Test Icon Title x". BB sets title and tooptip to the same string.
I hope the KDE people will come and have a look at this since I believe KDE behaves the same. Agreed, a bad idea running BB as root, you'd even have to set the owner of ~/.Xauthority to root in some cases. Interesting only that older Mint/Xfce didn't have the root requirement. |
By commenting out
|
Hey, thanks, that appears to work. New test program here: We'll make another Betterbird preview soon. |
I can confirm that the change from #20 (comment) makes the icon behave as intended when running as non-root under Gnome 43.2. |
Newest BB preview: This should show the icon on Gnome, Xfce and KDE without root privileges. On Xfce and KDE an additional tooltip/title should be displayed as shown in #20 (comment). |
Very nice! Ideally, I would love to have a "close to tray" option, and even nicer that a click on the tray icon would minimize to tray if betterbird is open and show betterbird if it was closed. But that could be a separate FR. |
A propos "minimise to tray": Check this question and this answer. It's now tracked here: Just digging through some old TB bugs: This feature request here is https://bugzilla.mozilla.org/show_bug.cgi?id=18732 from 1999. Worth the 24-year wait. |
Ok I think the correct issue to discuss that is this one #71 |
Tested with Manjaro GNOME. Results as expected:
I do not really need a tooltip like that, so it's no big deal for me. I'm more wondering if we get the "unread/new" message count somewhere? Saw it's available in the taskbar logo for windows but it isn't for linux (at least not for me). |
Yes, that's called the task bar badge on Windows. It's only shown for a wide/large taskbar. TB did that in https://bugzilla.mozilla.org/show_bug.cgi?id=715799#c35 with this code: |
@hockeymikey @Zahrun @Posi81 @mfschumann @felixoi : could be please attach some screenshots of the icon in the systray. Currently we supply (old?) standard size of 22px, but that might look bad/fuzzy on some high resolution displays, like seen here: We're happy to supply larger icons, of course then running the risk that it will look bad when scaled down. Not sure what the right size should be. Windows uses .ico files which combine various sizes into the one file. Experiments showed that SVGs also appear to work. In theory they should scale well to whatever size is required. BTW, the 22px size is observed on our Xfce systems and also described here. |
OK, yet another test program with SVG coming up. Uff, KDE breaks the title into multiple lines, that will run into trouble with long folder lists. |
So here's the test program with SVGs. I've that's good, I'll ship it in BB. Mind you, on our older Xfce 4.14 the SVGs are not clipped properly, on Xfce 4.16 they are. |
Thanks. OK, let's go with the SVGs. 102.7.0 is shipping today |
You can download the official version from the BB website now. |
I'm using KDE on Arch, but not seeing the systray or anything. Would be a slick feature. I figure the current one is Windows only?
The text was updated successfully, but these errors were encountered: