Skip to content
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

Feature request: Add support for showing notification count for applications. #20

Closed
OlegOAndreev opened this issue Aug 14, 2012 · 38 comments · Fixed by #1961
Closed

Feature request: Add support for showing notification count for applications. #20

OlegOAndreev opened this issue Aug 14, 2012 · 38 comments · Fixed by #1961

Comments

@OlegOAndreev
Copy link

It would be useful to (optionally) show the number of notifications, which were emitted by each application. An example can be seen in the following screenshot: http://cloudfront.omgubuntu.co.uk/wp-content/uploads/2011/04/screenshotae_thumb.png

I'm willing to propose a patch if you like the general idea.

@micheleg
Copy link
Owner

I'm more than happy if you want to contribute and improve the extension in any way. Moreover, I like the general idea of notifications on each application launcher.

In the last versions I started extending the appWellIcon class (in particular have a look to the preview version). Probably you want to start from there, but any other idea or suggestion, even a complete code overhaul if needed, are welcome. I look forward to seeing your patch. Let me know if you need help. Good work!

@OlegOAndreev
Copy link
Author

I've implemented basic support for showing notification counts within application icons here: https://github.com/OlegOAndreev/dash-to-dock

One of the things that are bothering me right now is choosing appropriate CSS style for the counter. The currently chosen 'summary-source-counter' does not look to good with e.g. Zukitwo theme.

Anyway, looking forward to your comments!

@vrutkovs
Copy link

I've tried running the branch from OlegOAndreev and the extension seem to work pretty fine - so merging it in the upstream branch would add a great and pretty stable feature

@micheleg
Copy link
Owner

First of all, thank you for your great work. I'm running you version now to see how notifications work. I like it. No particular problem so far, only some small inconsistencies or redundancies probably not linked to the extension itself. I haven't had time yet to look at the code carefully. It's good that someone else is testing this new feature, but I want to study it before merging to master. Since I hope to release a new version in the next days, I'll consider merging this branch later.

As it regards CSS style, I concluded that we need to really support only the default theme and try to do our best to make the result at least acceptable with generic theme: using a built-in class is a good starting point. If it's not enough, I think it's more important to make as easy as possible for theme writers to directly support the extension with specific css rules - some documentation would also help - and also allowing the final user to disable conflicting features with settings.

@vrutkovs
Copy link

I guess, the only issue I've found during the day is that notification count is not cleaned up when the app is being switched to using the dock (it works fine when notification is being clicked - but when I click on app instance in the dock the notification remains)

@OlegOAndreev
Copy link
Author

@micheleg I would not advise to merge the code right now actually :-) Empathy chat notifications do not show up and I'll look into it in the next couple of days.

@roignac Could you tell me what application were you running, please?

@OlegOAndreev
Copy link
Author

Really embarrassed for closing/reopening the issue, still new to the Github.

@vrutkovs
Copy link

@OlegOAndreev I can reliably reproduce this in Lightread and Geary, however
I'm sure this is actual for other applications, which use notifications

@micheleg
Copy link
Owner

micheleg commented Sep 9, 2012

@OlegOAndreev I've been busy in the last weeks and I still be for at least another one. Then I think the priority will be to porting the extension to the 3.6 release.

However, I started looking at your code and, even if I haven't still well understood how gnome-shell notifications work, I have some preliminary considerations.

  1. I would move more code inside the myAppWellIcon class. One reason is that I've tried to customize the dash class as less as possible in order to merge upstream changes more easily. The other is that this is the way the other indicators. i.e. windows counter and focused app, work.
    I would prefer that each icon handles its own notifications. I hoped there was some built-in per-application notification signals, but I haven't found anything so far. Perhaps you have investigated further. This would solve also the problem of overwriting the _updateCount functions. If there is nothing like this, we unfortunately still have to trigger the notification update from outside. Perhaps using a custom signal applied to the dash class could make the code more simple.
    I admit that adding feature after feature my classes and files organization would probably need to be reconsidered. But for the time being I would stick with it.
  2. Do we really need a function to disable and enable notifications? I think we could accept that only new notifications are added and the old ones are deleted by the user interaction. The only situation where this happens is when the user changes settings. But if this doesn't add complexity, let's keep them.
  3. I would also add a custom css class to icons with notification, so that theme writers can further customize the appearance.
  4. A general consideration. Do we really want notification counters or an icon alerted status could be enough? I'm thinking about this because you are probably inspired by unity, but there the application controls the notification. So for instance the email client displays the number of unread mails, while we display only the number of notifications. This could be deceiving for the final user. What do other docks do?

@OlegOAndreev
Copy link
Author

@micheleg

  1. Yes, we definitely need to wait for 3.6 'cause that release adds a proper way to monitor notification events: 'summary-item-added' from MessageTray and 'count-updated' from MessageTray.Source. That will allow us to move all notification-related code into myAppWellIcon.
  2. Sorry, but I do not understand, what function are you talking about?
  3. I'm 100% for this. The largest problem for me currently is the "unnoticeability" (pardon my bad English) of the blue counter on my blue background. It would probably be a good idea to make the counter red by default (but allow themes to modify the color).
  4. The counter was inspired not only by Unity, but by Gnome Shell message tray. I do not own a Mac, but according to http://osxdaily.com/2011/02/28/mac-os-x-lion-adds-ios-style-notifications-to-dock-icons/, the Mac OS X Dock displays the number of notifications there too. Do you any specific plan in mind on how to highlight the "alerted status" of an icon? Would it be a small icon in the corner or a change of icon background or anything else? Probably, we could implement a setting, allowing both?
  5. Another consideration from roignac: we should probably remove all application notifications when the application icon is clicked. What do you think of this, michele?

@OlegOAndreev
Copy link
Author

Dammit, how do I remove the damned "Comment & Close" button from the UI?

@OlegOAndreev OlegOAndreev reopened this Sep 9, 2012
@OlegOAndreev
Copy link
Author

@roignac Would you be so kind as to try the latest revision of my patches. It should fix your problems with notifications not disappearing when icon is clicked.

@vrutkovs
Copy link

@OlegOAndreev it seems that notifications are not displayed in the dock in Gnome 3.5.91. I tried Empathy, Thunderbird, Rhythmbox (i suppose it shouldn't be displayed anyway), Lightread and Skype

UPD: It seems that the app updates notifications count only on 'show notifications' setting change - this makes this feature almost unusable

I'll try to test the latest code on Gnome 3.4 later this day

@micheleg
Copy link
Owner

@OlegOAndreev From that link it seems that actually applications like mail and chat do display the number of unread messages. Anyway, it was just an observation.

Aren't notification already cleared when an application is activated?

@OlegOAndreev
Copy link
Author

@micheleg They are cleared if an application is not already focused. E.g. if Thunderbird is focused and new mail arrives, you can clear notifications by switching to another application and back or by clicking "open" or "close" on the notification in the message tray.

@aurelien-naldi
Copy link
Contributor

I tried to merge your branch with 3.6 branch (some conflicts but nothing annoying) and it failed to load the extension with the following error:
No JS module 'telepathyClient' found in search path
Does it work with 3.6 for you?

@OlegOAndreev
Copy link
Author

No, I haven't tried the 3.6 yet (waiting for Fedora 18 to be released), and there are plans to rewrite the patch for 3.6.

@mreq
Copy link

mreq commented Jan 11, 2013

Anything new here? That feature would be nice. A simple css class would suffice though. Just to style the icon a litle bit different when it has notifications. Don't need a number...

@zeraien
Copy link

zeraien commented Mar 6, 2017

What happened with this? Any plans on implementing, is it worth it taking a crack at the code?

@micheleg
Copy link
Owner

@zeraien This was never finalized and merged and I don't think I am note personally motivated to work on it, as I don't feel the need to overhaul the default Gnome behaviour. Should someone want to try to improve this feature, i'm open to consider its integration, yet I can't promise much of my attention given the time I can dedicate to this project.

@gochev
Copy link

gochev commented Apr 1, 2017

so sad I would love such feature :( @OlegOAndreev is gone :) and I guess this will never be rewritten and merged ? :( This is like the biggest thing I miss from my Mac when using Gnome. Is there any other similar extension or something that supports notification badge counts on apps ?

@Feichtmeier
Copy link

Feichtmeier commented Apr 15, 2017

Awesome extension!
Though I miss this really. Progress bars of downloads and unread mail count from geary. That would make it perfect. @gochev you could use plank, like I do, but it just feels redundant to install another dock when there could be this one

@micheleg
Copy link
Owner

Also, download progressbar and unread messages count (vs unread notifications count) is not a freedesktop standard and is supported by ubuntu/libunity and derivative (elementary) only. This makes the notifications a bit less helpful. I personally don't want to target a specific platforms (which i don't run). I have no idea what will happen to unity support in applications now that the project has been deprecated.

@Alexander-Wilms
Copy link

Alexander-Wilms commented Apr 16, 2017

KDE also supports libunity: http://blog.broulik.de/2016/01/on-being-more-convenient/
If Gnome could reuse the Unity LauncherAPI, that'd be great. In that case it could probably become a freedesktop standard.

I filed a bug report regarding libunity support in Gnome: https://bugzilla.gnome.org/show_bug.cgi?id=781368

@k3a
Copy link

k3a commented Apr 23, 2017

Yes, this is probably the feature I miss the most, too. I used Plank on Linux which has some kind of "notification" dot but I can't use Plank when in Wayland. Other than that this extension works perfectly for me.

@owais
Copy link

owais commented Jun 7, 2017

I wouldn't hold my breath on Gnome accepting anything unity. Unity wouldn't exist if that was possible :)

Anyway, there has been some discussion in Gnome bug tracker around this and it looks like Gnome might be open to accept a NEW API to implement things like these. https://bugzilla.gnome.org/show_bug.cgi?id=701402#c13.

It would be great if just libunity API was accepted as all existing apps would become so much better inside Gnome Shell but a new API wouldn't be so bad either. May be a linunity shim can b created later to add support for libunity in Gnome shell.

@micheleg
Copy link
Owner

micheleg commented Jun 8, 2017

@owais Thanks for the information.

@krasi-georgiev
Copy link

bump so it doesn't get forgotten :)

@owais
Copy link

owais commented Jan 8, 2018

This is already implemented in ubuntu-dock now and I think might be up-streamed but not sure about that.

@micheleg
Copy link
Owner

This is indeed implemented in dash-to-dock (as of version 62, awaiting for review on the extension website but available here: https://micheleg.github.io/dash-to-dock/releases.html) as it is in Ubuntu-dock. The main limitation is that it only works in Ubuntu (and derivatives) as it uses Unity own dbus protocol to retrieve the notification information.

@nkkollaw
Copy link

@micheleg : I've installed X and GNOME on top of Ubuntu Minimal CD (upgraded to Bionic).

Is there a specific package that I can install to enable this functionality? Ubuntu is now a slighly modified GNOME desktop, so it should be possibile..?

Thanks!!

@nkkollaw
Copy link

@micheleg : I've installed GNOME on Ubuntu Minimal CD (upgraded to Bionic).

Is there a specific package that I can install to enable this very useful functionality?

(on a side note, I'm still confused as to what relationship Ubuntu has with Unity anymore. I guess it's been kept around for all the APIs..?)

@micheleg
Copy link
Owner

micheleg commented Mar 4, 2018

@nkkollaw sorry for the late reply. I believe that on Ubuntu (and derivatives) as long as you have version 62 you should get the notification badges without having to install any additional package. Did you manage to get it working?

@nkkollaw
Copy link

nkkollaw commented Mar 5, 2018

Hi sure--no problem!

I never got it to work, unfortunately. I had installed Ubuntu via the minimal CD install so it's very possible that I was missing some package.

I've since moved back to Xfce though, so that somewhat solved that problem :-)

@nickbien
Copy link

nickbien commented Oct 6, 2020

Bumping thread :)

@kernelb00t
Copy link

Very interesting feature ! Could be interesting and very useful to certain users @OlegOAndreev @micheleg
But this issue is a bit old, can't it be added in the README hoping some people passing by may get interested in the feature (and maybe dev a PR?) ?

@3v1n0
Copy link
Collaborator

3v1n0 commented Feb 24, 2023

This is supported for long time using libunity APIs, so closing.

@3v1n0 3v1n0 closed this as completed Feb 24, 2023
@3v1n0 3v1n0 reopened this Feb 24, 2023
@3v1n0
Copy link
Collaborator

3v1n0 commented Feb 24, 2023

Sorry, I was thinking about unity emblems, I was wrong.

3v1n0 added a commit to 3v1n0/dash-to-dock that referenced this issue Mar 7, 2023
Support monitoring notifications that are still around in the shell
notification tray and use it to increase the icon indicators count.

This is not visible in case we are in do-not-disturb mode.

Closes: micheleg#1861, micheleg#20
3v1n0 added a commit to 3v1n0/dash-to-dock that referenced this issue Mar 7, 2023
Support monitoring notifications that are still around in the shell
notification tray and use it to increase the icon indicators count.

This is not visible in case we are in do-not-disturb mode.

Closes: micheleg#1861, micheleg#20
@3v1n0 3v1n0 linked a pull request Mar 7, 2023 that will close this issue
3v1n0 added a commit that referenced this issue Mar 7, 2023
Support monitoring notifications that are still around in the shell
notification tray and use it to increase the icon indicators count.

This is not visible in case we are in do-not-disturb mode.

Closes: #1861, #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.