Foundry376 / Mailspring

:love_letter: A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
https://getmailspring.com/
GNU General Public License v3.0
15.48k stars 901 forks source link

Ubuntu 17.10 GNOME DE: no ICON badge for unread mails #420

Closed Feichtmeier closed 3 years ago

Feichtmeier commented 6 years ago
Are there any related issues?

...

What operating system are you using?

... Ubuntu 17.10 GNOME DE

What version of Mailspring are you using?

... 1.0.10

--

Bug?

Do you have any third-party plugins installed? If so, which ones?

... No

Is the issue related to a specific email provider (Gmail, Exchange, etc.)?

... I do not know, but I think not bildschirmfoto von 2017-12-10 13-37-34

Is the issue reproducible with a particular attachment, message, signature, etc?

...

--

Feature Request?

Does this feature exist in another mail client or tool you use?

... Yes, this feature exists in Geary Mail, a GNOME Desktop e-mail client written in Vala. It uses the unity launches API. Details can be read here: https://github.com/micheleg/dash-to-dock/pull/590 As they made it work for GNOME DE which is now (since 17.10) the OFFICIAL Ubuntu DE

bengotow commented 6 years ago

Hey! Thanks for reporting this - I believe we support the Unity Launcher API. How did you change the icon in the dock? I wonder if changing the icon also prevents the app from attaching it's badge?

Feichtmeier commented 6 years ago

Hi, no - changing the icon does NOT kill the badge functionality. For example Geary Mail can display the badges no matter if I use the offical branded icon or the one from an icon theme. (You can change icon themes in GNOME and most other DEs with either a bash command or gnome tweak tool, really easy and just one click)

Ads20000 commented 6 years ago

Is it the snap that you're using Feichtmeier?

(If you don't know, run snap run mailspring and see if that has the issue, also run /usr/bin/mailspring (I'm assuming that's where the Deb installs to?) and see if that has the issue; if the second one doesn't work at all then you've got the snap installed, not the Deb)

Feichtmeier commented 6 years ago

Atm I am using the Deb because the snap version lacks the menu bar theming =) But miss the badges on both deb and snap version

bildschirmfoto von 2018-01-05 22-43-50

ivashin commented 6 years ago

Same issue on Ubuntu 16.04 Unity with v. 1.0.12-cf081332 installed via snap. Launcher icon show no badge. Icon is the default one. App indicator shows a blue dot when a new message arrives which disappears one the app is activated.

markkuit commented 6 years ago

Same issue on Debian 9 with KDE 5.8.6

asaphaaning commented 6 years ago

Ubuntu 18.04 Same issue. Installe dvia snap.

Feichtmeier commented 6 years ago

I can confirm this issue on Ubuntu 18.04 Deb and snap @bengotow

oliverbienert commented 6 years ago

I can confirm this too. Ubuntu 18.04, installed from deb. There is a blue dot when new mail arrives, but not always, I'm quite sure.

Feichtmeier commented 6 years ago

@bengotow when the screen is locked, the notification on the lock screen pops up as "electron" in name. Maybe this is somehow connected to this issue? I guess that the API wants to place the badge on the icon that is attached to the dock -> mailspring. I will test this by renaming the "Name=..." .desktop file and report back

Edit: nope changing the name didn't change anything :( Anyways, somehow the notifcation is send my "Electron" and not mailspring

eliocamp commented 5 years ago

Hi! This issue affects elementary Os also. Specially in the new Juno release since they got away with system tray icons. It would be a very nice feature to have!

bdaase commented 5 years ago

Ubuntu 18.10 with Gnome 3.30 has the same problem.

arkraft commented 5 years ago

I use Ubuntu Mate 18.10 and got it working last week. I looked at the source code of Plank and found out that the use the name of the application to find the corresponding desktop file. The desktop file plank is looking for is called Mailspring.desktop. The one i had after installing it was called mailspring.desktop. I renamed the file and voila, i have a badge now. The one created by snap is mailspring_mailspring.desktop. You will also need libunity, but i believe this is installed with Plank, just in case. Hope it helps

Edit: added an image of the badge image

eliocamp commented 5 years ago

Working on elementary OS Juno! (The file is in /usr/share/applications/)

arkraft commented 5 years ago

@eliocamp Great! And thanks for adding the directory, i forgot it

bdaase commented 5 years ago

@arkraft Unluckily, it seems not to work for me. I renamed the file from mailspring.desktop to Mailspring.desktop, restarted but still have no badge....

arkraft commented 5 years ago

@BjoernDaase I am sorry it did not work. You could try the following. Open up the terminal and kill all instances of plank (killall plank) and start a new instance (plank). Now you should see log messages of plank. Does it print an error when you open up mailspring?

You could also check if libunity is installed: apt list --installed | grep libunity (i don't know if there is a more elegant way, but it worked for me) and install it if not

bdaase commented 5 years ago

@arkraft You don't have to be sorry, it's definitely not your fault! Plank also doesn't show a badge as well (even after killing and restarting). Anyhow, it throws some warnings:

[WARN 22:56:56.206730] [Environment:161] XDG_SESSION_CLASS not set in this environment!
[WARN 22:56:56.252880] [Preferences:192] '/usr/share/plank/themes/Default/dock.theme' is read-only!
[WARN 22:57:03.069182] [LIBDBUSMENU-GLIB] Unable to get session bus: Operation was cancelled

Do they help you?

Libunity seems installed:

libunity-protocol-private0/cosmic,now 7.1.4+18.04.20180209.1-0ubuntu2 amd64 [installed]
libunity-scopes-json-def-desktop/cosmic,cosmic,now 7.1.4+18.04.20180209.1-0ubuntu2 all [installed]
libunity9/cosmic,now 7.1.4+18.04.20180209.1-0ubuntu2 amd64 [installed]
arkraft commented 5 years ago

@BjoernDaase I checked my desktop file again and i have changed the Exec path to env XDG_CURRENT_DESKTOP=Unity /usr/bin/mailspring %U. I just removed it and it did not show the badge, adding it again returned the badge. Could you also try that

bdaase commented 5 years ago

@arkraft Thank's for your help! I changed it but unluckily didn't help either...

arkraft commented 5 years ago

@BjoernDaase It was the last thing i can think of. This may sound dumb, but did you only close the window or quit Mailspring using the tray icon?

bdaase commented 5 years ago

Sure.

arkraft commented 5 years ago

Could you show me the content of your desktop file. I tried so much, maybe i changed more and forgot it^^

bdaase commented 5 years ago

Sure,

Version=1.1
Type=Application
Name=Mailspring
GenericName=Mailspring
Comment=The best email app for people and teams at work
Icon=mailspring
Exec=env XDG_CURRENT_DESKTOP=Unity /usr/bin/mailspring %U
Actions=
MimeType=x-scheme-handler/mailto;x-scheme-handler/mailspring;
Categories=Email;GNOME;GTK;Network;
StartupNotify=true
StartupWMClass=Mailspring
arkraft commented 5 years ago

I just fired up a virtual machine with Ubuntu 18.10 to try and reproduce the problem. I installed Mailspring (the .deb, not snap) and renamed /usr/share/applications/mailspring.desktop to /usr/share/applications/Mailspring.desktop and i had the Badge: image

Feichtmeier commented 5 years ago

Yeah sorry about the theming issue, our badges are actually green, but it is fixed now in 18.4 and will be fixed in 19.4 :) https://github.com/ubuntu/yaru/pull/934 https://github.com/ubuntu/yaru/pull/931

image

The fix works! Thank you @arkraft

bdaase commented 5 years ago

Weird, I used the DEB also. But something has to be wrong with my configuration.... screenshot from 2018-11-29 22-38-44

arkraft commented 5 years ago

That's weird. Did you change the settings after installation, specifically the Show badge on the app icon setting? And also, do you have a mailspring.desktop file in ~/.local/share/applications/? Maybe they are conflicting?

bdaase commented 5 years ago

@arkraft Sure, it's set on 'Show unread count' and the ~/.local/share/applicationsfolder has no Mailspring like entry.

Feichtmeier commented 5 years ago

I think the best would be to test it on fresh Installations of Ubuntu and mailspring

Feichtmeier commented 5 years ago

@bengotow could you use that fix to get back the badge counters for ubuntu users? Just make the desktop file be Mailspring.desktop Otherwise I need to sudo mv /usr/share/applications/mailspring.desktop /usr/share/applications/Mailspring.desktop everytime a mailspring update hits : / Best regards

smashingx1 commented 5 years ago

I'm using Linux Mint Debian Edition with MATE as the Desktop environment, how can I make this to work?!

arkraft commented 5 years ago

@smashingx1 Have you tried the renaming fix? I also have MATE and it worked for me.

smashingx1 commented 5 years ago

@arkraft Are you using MATE with ubuntu or LMDE? I just renamed the file like you suggested and still didn't work. Do you have a screenshot of how yours work? I was just wondering if the count is showing in the icon that is palced in the system tray or the actual window? And can you please tell me where did you see in the code that the requested Desktop file that is looking for is Mailspring not mailspring, so I can troubleshoot this as well? Thank you This is how mine looks like after I renamed the file and when I have unread email: screenshot

arkraft commented 5 years ago

@smashingx1 You were talking about the tray icon, i'm not even sure if it is supposed to show the count to be honest. What i was referring to was the plank icon. image

I found the issue in the plank code, it was searching for the desktop file using the name of the application, which is Mailspring and not mailspring, and therefore could not find it. I don't know where you would start to search for the tray icon as i believe this is not a bug.

smashingx1 commented 5 years ago

@arkraft Thank you for your help. I thought you said that you were also using MATE. AFAIK MATE doesn't have that plank feature that you are describing, am I wrong? And if plank is always required to show the count in the badge, then I think it should be specified in the settings when you want to choose if you want the count or not.

arkraft commented 5 years ago

@smashingx1 I am using Ubuntu MATE and Plank was there from the beginning. And there is a setting for that: "General -> Show badge on the app icon". You can select to show unread emails, all emails or hide the badge.

smashingx1 commented 5 years ago

@arkraft That's correct, And that's what I have selected. I selected the count for unread emails, but it's just showing the little dot I showed you on my earlier screenshot. I tried to see if I should install plank on for debian, but it's almost impossible, it requires so many dependencies.

smashingx1 commented 5 years ago

@arkraft And just to clarify Linux Mint is based on Ubuntu, but Linux Mint Debian edition is based in Debian, so sometimes whatever applies to Ubuntu doesn't apply to LMDE, but whatever applies to Debian applies to LMDE.

arkraft commented 5 years ago

@smashingx1 Sorry for the late answer. The option " Show badge on the app icon" is meant for the plank app icon, not the tray icon. There is no option to display the count of unread emails in the tray. This icon simply has three states: unread emails, all read, empty inbox. The little dot you mention is the icon showing unread emails. That's all there is. If you want to see the number you need to use the plank of the Unity desktop, as these are the only supported (i think).

arkraft commented 5 years ago

@BjoernDaase Have you managed to get it working? I installed ElementaryOS on sunday and with the renaming fix it's also working here, without any other changes.

bdaase commented 5 years ago

@arkraft Nope, still not working. A Gnome reinstallation didn't help either. I might have to reinstall my complete Ubuntu, but currently do not have the time to do so.

smashingx1 commented 5 years ago

@arkraft I think with the new update to the icon it's randomly notifying when I have a new email or not. Sometimes I get notified and there's new email and sometimes there's new email and I don't get the icon to show blue.

arkraft commented 5 years ago

@smashingx1 The new update only replaced the image, not the logic. I think threre is an issue open for that too.

Feichtmeier commented 5 years ago

Can't the maintainer just rename the desktop file? @bengotow ???

jayarjo commented 5 years ago

@arkraft @Feichtmeier do you know why renaming file works?

arkraft commented 5 years ago

@jayarjo Plank uses the AppId to search the Desktop file for the App. The AppId of Mailspring is Mailspring which is why Plank is looking for a Mailspring.desktop file. The original Desktop file after the installation is mailspring.desktop or if you used snap mailspring_mailspring.desktop. So renaming the file is the easiest way for Plank to find it. I just don't know why for some it is still not working.

danielwangksu commented 5 years ago

Thanks! I confirm this solved my problem on the latest ubuntu 18.04

IjonFryderyk commented 4 years ago

Hi, I have the same problem on Ubuntu 18.04. The renaming fix works only with deb version. Snap version doesn't create desktop file in usr/share/applications and bin entry. I would like to use snap version because of its automatic updates.

Feichtmeier commented 4 years ago

I would recommend everyone to just switch to the latest Thunderbird. Notification badges work great and also have a calendar integration. It also starts 5x faster. :+1: