|Issue 676220||Native desktop notifications on Linux|
|Starred by 20 users||Reported by mich...@lawton.nz, Dec 21||Back to list|
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: 1. Trigger a desktop notification (e.g. https://davidwalsh.name/demo/notifications-api.php) What is the expected behavior? The notification should use the desktop environment's notification system. What went wrong? The notification is displayed by Chromium's built in notification system. Did this work before? No Chrome version: 55.0.2883.87 Channel: stable OS Version: Flash Version: Shockwave Flash 24.0 r0 The freedesktop.org specification (https://developer.gnome.org/notification-spec/) is supported on many popular distributions on Linux. Notification servers implementing the specification are available for distributions and desktop environments which do not include support by default. There are libraries (such as libnotify) available such for various languages which implement the specification. A good overview of desktop notifications on Linux is https://wiki.archlinux.org/index.php/Desktop_notifications There is a libnotify based extension for Firefox: https://addons.mozilla.org/en-US/firefox/addon/gnotifier/ At one time there were extensions available for Chromium but they were dependant on NPAPI
Confirming since someone on IRC asked about this exact thing.
I believe Gtk has a freedesktop-compliant notification API. It wold probably make implementation relatively painless
I can confirm this on Ubuntu 16.04 LTS.
> I believe Gtk has a freedesktop-compliant notification API. It wold probably make implementation relatively painless GLib (Gio) has the GNotification API but it only is usable if you use GApplication which I presume Chromium never will. So you would either have to re-implement that yourself which is fairly trivial DBus usage or use a third party library like libnotify (which I would not recommend as it is a blocking API, though it could give a rough idea of usage).
There's not much to the Dbus notifications API. I wrote a 100% async python module for use in Pithos so that we could rid ourselves of libnotify. (https://github.com/JasonLG1979/possibly-useful-scraps/blob/master/GioNotify.py) You don't need GApplication if you don't want to use it. All you need is Gio, Gobject, and Glib. You really don't even need that. I'm sure you could talk to Dbus without any tookit specific code if you wanted to. The notification spec is not desktop/toolkit specific. Although different desktops expose different features. For example, some allow for buttons in notifications and some don't and so on.
Today (14 hours ago),
I'm not sure if it should be enabled by default since the native notification system works quite differently across the Linux desktop environments. On some desktops, like Unity, notifications aren't even clickable. Yes, native notifications look more consistent with the system UI, but it'll make behaviour and functionality of Chrome/Chromium notifications inconsistent across the DEs. For now, a simple chrome://flags switch would be a great thing to have, so the users can decide if they want it or not.
Today (6 hours ago),
> On some desktops, like Unity, notifications aren't even clickable. For some people, that's a plus. And if it's something someone couldn't live with, he wouldn't chose Unity in the first place.
|► Sign in to add a comment|