Dash-to-dock: Feature request: Add support for showing notification count for applications.

Created on 14 Aug 2012  路  35Comments  路  Source: micheleg/dash-to-dock

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.

Feauture request contribution

Most helpful comment

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.

All 35 comments

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!

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!

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

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.

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)

@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?

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

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

@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?

@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?

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

@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.

@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

@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?

@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.

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?

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.

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...

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

@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.

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 ?

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

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.

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

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.

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.

@owais Thanks for the information.

bump so it doesn't get forgotten :)

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

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.

@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!!

@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..?)

@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?

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 :-)

Bumping thread :)

Was this page helpful?
0 / 5 - 0 ratings