[Linux] Notifications Not Showing Properly #465

Closed
Subash opened this Issue Jul 7, 2014 · 47 comments

Comments

Projects
None yet
Contributor

Subash commented Jul 7, 2014

Notifications on Ubuntu are shown as alerts instead of regular notification.
Is this how notifications are supposed to look on ubuntu ?
ubuntu____running_

@Subash Subash changed the title from [Linux] Notifications Alert Only to [Linux] Notifications Not Showing Properly Jul 7, 2014

@probablycorey probablycorey added the bug label Jul 21, 2014

@zcbenz zcbenz added the linux label Aug 19, 2014

Contributor

zcbenz commented Aug 19, 2014

What's the version of Ubuntu and were you using Unity?

Contributor

Subash commented Aug 21, 2014

It's a virtualbox VM with ubuntu 14.xx LTS.

Contributor

zcbenz commented Aug 21, 2014

Can you run notify-send summary body under terminal and see if it shows a proper notification? Notifications on Linux sometimes can not work very well in virtual machines.

Contributor

zcbenz commented Oct 14, 2014

I'm closing this for lack of information, please reopen if you can provide more information.

@zcbenz zcbenz closed this Oct 14, 2014

sidoh commented Apr 1, 2015

I'm having this issue as well. I'm running ubutnu 14.04.2 LTS.

notify-send shows the system notifications I'd expect to see (growl-esque notifications in the top-right of my screen).

Notifications in the atom-shell app I'm trying to use and when I create them manually (with new Notification("msg")) show these ugly alert boxes:

screenshot

Any idea how to resolve this?

Contributor

zcbenz commented Apr 2, 2015

@sidoh Can you download Atom editor and see if the sending a notification works in its devtools? On some distributions the notification can only show correctly if the application is "installed".

sidoh commented Apr 2, 2015

I installed atom from this PPA:

http://www.webupd8.org/2014/05/atom-text-editor-ubuntu-ppa-update.html

Within atom's DevTools I'm getting the same thing (ugly alert with new Notification).

Contributor

paulcbetts commented Apr 2, 2015

I've seen this bug too, it's super distro-specific 😿

Contributor

zcbenz commented Apr 2, 2015

Can you try removing the libnotify.so shipped with atom-shell? It possible that the one shipped with atom-shell is too old. You may have to create a symbol link to system's libnotify library to make it run.

sidoh commented Apr 2, 2015

I tried removing it. I relaunched atom and ran the same test with the same result.

I also dropped /usr/lib/x86_64-linux-gnu/libnotify.so.4 into the atom install folder with the same result.

Is this what you intended for me to do?

Contributor

zcbenz commented Apr 2, 2015

Yeah that is what I intended, thanks.

I think maybe the distribution has some kind of whitelist of sending notifications since different distribution yields different results, so reporting it to the distribution's bug tracker could probably gets some solution from the developers there.

pekim added a commit to pekim/slack-wrapped that referenced this issue May 17, 2015

Use builtin notification support intead of node-notify.
There was a problem with notifications rendering incorrectly on Ubuntu.
Somewhat similar to that reported in electron/electron#465 .
This appears to have been fixed in electron v0.25.0, so the use of node-notify is
no longer necessary.

This bug is valid again. Worked fine with 0.28.3, but with 0.36.7 it fails.

Contributor

paulcbetts commented Feb 12, 2016

@markbaas Install Unity (you don't have to use it, just have it)

@paulcbetts I'm using unity

Major applications such as N1 and Slack are affected.

Tried all electron versions from 0.28.3 until 0.36.6 and it breaks on 0.33.5

Perhaps this worked in previous versions of Ubuntu, at least not in 16.04. On unity electron wants to use unity specific variables, this code breaks that:
https://github.com/atom/brightray/blob/master/browser/linux/libnotify_notification.cc#L31

// Look for the presence of libunity as our hint that we're under Ubuntu.
  base::FileEnumerator enumerator(base::FilePath("/usr/lib"),
                                  false, base::FileEnumerator::FILES);
  base::FilePath haystack;
  while (!((haystack = enumerator.Next()).empty())) {
    if (base::StartsWith(haystack.value(), "/usr/lib/libunity-",
                         base::CompareCase::SENSITIVE)) {
      unity_result = true;
      break;
    }
  }

Instead it should look at running processes IMO.

Contributor

paulcbetts commented Feb 13, 2016

@markbaas The problem is that fundamentally, the thing we need to detect is, "Does libnotify (or in reality, the service it signals via DBus) have Ubuntu's special patches applied that disable actions". There is no sane way to detect this.

Even if Unity isn't being used at all (i.e. Xubuntu based on Xfce, etc), if libnotify is patched, you'll get the dialog box. You can't detect based on distro name either, because lots of distros like Elementary OS are based on Ubuntu and therefore inherit Ubuntu's brain-damaged notifications while not being called "Ubuntu". While I'm totally on-board with coming up with a better heuristic (since this one fails too in a number of scenarios), it's Not So Easy to do so.

@paulcbetts paulcbetts reopened this Feb 13, 2016

Contributor

paulcbetts commented Feb 13, 2016

It appears that Ubuntu 16.04 will break the code in Brightray to detect this, we'll have to update it or come up with a better plan

@markbaas markbaas referenced this issue in electron-archive/brightray Feb 15, 2016

Closed

[Unity] more elegant solution to unity detection #197

I propose the following file change. atom/brightray#197

I couldn't test it as I wasn't able to compile electron (tried all weekend).

i have the same issue in ubuntu 16.04 :(

+1 16.04

ennui93 commented Mar 25, 2016

Also seeing this in a fresh, native install of Ubuntu 16.04.

notify-send summary body on the Terminal gives desktop notification as expected.

Slack app emits these:
electron alert from slack - pii removed

Largest annoyance is that the alerts stack up and persist, so one needs to click Cancel for every message received.

I was having the problem described here, on Arch Linux. I ended up doing the following, which is good enough for me, in that it now displays notifications in a less intrusive way:

sudo pacman -R notify-osd
sudo pkill notify-osd
sudo pacman -S mate-notification-daemon

Note that I use the mate-notification-daemon, even though I don't use the Mate desktop. It works fine for me on the i3 window manager.

I hope this helps.

TrafeX commented Mar 29, 2016

I've the same issue on Ubuntu 16.04. I can't use the workaround mentioned above, other programs need notify-osd. Any other workarounds? This breaks the notifications for both Slack and Nylas.

@MarshallOfSound MarshallOfSound referenced this issue in MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL- Mar 29, 2016

Closed

Added notification capabilities. #839

I suspect this is related to this bug logged against notify-osd.

https://bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/1277430

I'm seeing this behaviour on my system with Electron apps (Slack).

This works correctly:

notify-send body summary

But this causes the undesired behaviour:

notify-send -t 0 body summary

If you're skimming this looking for a quick workaround for distracting Slack notifications:

sudo touch /usr/lib/libunity-electron_notification_fix

See: #465 (comment)

Contributor

3v1n0 commented Apr 12, 2016

Yeah, @jamesadney is what is expected to work.

The reason why this broke in 16.04 is that unity moved to multi-arch, thus the libunity files have been moved to /usr/lib/${ARCH}/libunity-*.
However I think that using this method for checking the desktop is wrong. A better one (not the best, but still) is the one proposed in electron/brightray#197, although it should be fixed as XDG_CURRENT_DESKTOP has to be handled as a :-separated list.

So, please fix electron.

PS: I'm an Ubuntu unity developer, if you need anything else. Also, about this topic, please give a look at bug #5052 :)

Contributor

paulcbetts commented Apr 12, 2016

@3v1n0 We would really love to detect patched notifier in a non-crazy way, do you have any better ideas about how to do this?

Contributor

3v1n0 commented Apr 13, 2016

@paulcbetts I think the best way is just getting the server info from libnotify or the supported caps.

Just for being clear, here's what you get when running notify-osd:

>>> from gi.repository import Notify
>>> Notify.get_server_info()
(True, 'notify-osd', 'Canonical Ltd', '1.0', '1.1')
>>> Notify.get_server_caps()
['body', 'body-markup', 'icon-static', 'image/svg+xml', 'x-canonical-private-synchronous', 'x-canonical-append', 'x-canonical-private-icon-only', 'x-canonical-truncation', 'private-synchronous', 'append', 'private-icon-only', 'truncation']

@mcg mcg referenced this issue in nylas/nylas-mail Apr 19, 2016

Closed

No notifications on ubuntu #1165

slacknotification
still present for the slack app on ubuntu 16.04. any fix for this?

Member

MarshallOfSound commented Apr 24, 2016

@marcosfede The slack app will have to update electron versions before it is fixed

WystJenkins commented Apr 25, 2016

I got the same bug in Slack since updating to Ubuntu 16.04 .. no virtual machine

Same here with 16.04 in Franz app and Nylas N1.

Member

MarshallOfSound commented Apr 25, 2016

@philippgerard I'm just going to reiterate. Just because it is fixed here (upstream) doesn't mean that the individual apps that use electron have updated to a version of electron that has the fix....

So do we have a solution to this above issue. My Slack and every other notifications are coming as alerts after updating to Ubuntu 16.04.

mcg commented Apr 25, 2016

@Arihantar Workaround posted in this thread, and you can also export ELECTRON_USE_UBUNTU_NOTIFIER=1

@bengotow bengotow referenced this issue in nylas/nylas-mail Apr 25, 2016

Closed

Broken notifications on Ubuntu 16.04? #2050

xzitlou commented Apr 25, 2016

I tried export ELECTRON_USE_UBUNTU_NOTIFIER=1 but I'm still getting the same annoying Electron alerts on my Slack application..

mcg commented Apr 25, 2016

@xzitlou How to use that workaround is probably not for this bug thread. See #465 (comment) for another option that may work for you.

Had the same problem with Slack. #465 (comment) helped me

thanks @jamesadney #465 (comment) solved the Slack notification bug!

I'm on Ubuntu 16.04 using Mattermost desktop and #465 (comment) removed the annoying notifications but now I'm not getting any notifications at all.

Since I updated to Ubuntu 16.04 I'm also affected by this bug.

I am having same bug in ubuntu 16.04.

Guys... read the comment that was linked in this thread several times

@jwheare jwheare referenced this issue in irccloud/irccloud-desktop May 4, 2016

Closed

Annoying Notifications #30

ildella commented May 16, 2016

@MarshallOfSound is there a specific commit with the electron fix? Or better, is the fix inluded in one of the last release? https://github.com/electron/electron/releases Thanks

Member

MarshallOfSound commented May 16, 2016

@ildella It was fixed in electron release 0.37.6

@DivineOmega DivineOmega referenced this issue in mattermost/desktop May 17, 2016

Closed

Notifications on Ubuntu 16.04 #140

davidbanham added a commit to davidbanham/dotfiles that referenced this issue May 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment