7

When I use notify-send to send a simple message to notification-daemon:

notify-send "hello"

it not only displays the message but also creates a system tray icon, as shown on the screenshot below:

enter image description here

This icon will stay in the system tray until I click on it and select "clear all notifications". This icon completely defeats the purpose of notify-send as unobtrusive notification. I have used notify-send few years ago and I am sure it did not have any tray icon back than. Needles to say, this is absolutely annoying.

I have found that I can use transient option

notify-send --hint=int:transient:1 hello

Which makes the icon disappear after a certain time. This is better, but still not acceptable.

Is there any way to get rid of the tray icon entirely?

I am using LXDE on Debian Wheezy

Some answers suggest, this is caused by my desktop environment (LXDE).

I find it hard to believe. I still suspect this is caused by notification daemon. I have downloaded sources for notification-daemon package, and there in the CHANGELOG I see, among other things:

  • Added better support for attaching context notifications to an icon on the system tray, even when it moves. Patch by Colin Walters.

Which seems to be the "feature" that I am complaining about.

Can anybody advice how to disable systray notification in notification-daemon? When I grep the sources for tray or systray, I don't find anything. I don't know where to start.

Braiam
  • 35,380
  • 25
  • 108
  • 167
Martin Vegter
  • 69
  • 66
  • 195
  • 326

4 Answers4

4

As far as I can tell, you are right in attributing the system tray icon to notification-daemon. If you are not happy with the icon, try another notification daemon. Notifications work on the basis of client/server. Any notification client can communicate with any compatible server.

I myself am using dunst and I am very happy with that. It does not have any system tray notification.

There are several notification daemons, notification-daemon being only one of them. In Debian, you can list them with following command:

$ apt-cache search notification | grep daemon | grep notification
dunst - minimalistic notification daemon
inosync - notification-based directory synchronization daemon
notification-daemon - daemon for displaying passive pop-up notifications
notify-osd - daemon that displays passive pop-up notifications
xfce4-notifyd - simple, visually-appealing notification daemon for Xfce

I can recommend dunst. It is a minimalistic, yet highly configurable notification daemon.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Michael Boies
  • 156
  • 1
  • 6
  • 22
3

That icon has nothing, nothing to do with libnotify, nor dbus. This is entirely dependent of your DM/WM (I'm guessing cinnamon, but could be wrong) and dbus/libnotify can't do anything to control it.

For comparison: XFCE doesn't use such icon, and I'm aware that GNOME Shell does show a icon independently what method you use.

If you need to get rid of the icon, consult the documentation of your desktop environment, through if you are using a derivation of GNOME 3 it may be not possible.

Braiam
  • 35,380
  • 25
  • 108
  • 167
  • I am using `LXDE`. – Martin Vegter Dec 21 '14 at 01:04
  • I thought, LXDE only provides the system tray for applications to use. It is up to the applications whether/how they use the system tray. – Martin Vegter Dec 21 '14 at 01:09
  • @MartinVegter I've checked the reference again, is up to the notify server how to deal with the notifications they retrieve. I've found nothing in the reference that indicates otherwise. What I saw was that you can use hints so the item is destroyed along with the bubble, which in your case should dismiss the icon, but I figure you don't want the icon in first place either. – Braiam Dec 21 '14 at 01:40
  • Yeah, that icon does not appear for me in lxpanel. I've never seen it. – iyrin Dec 24 '14 at 20:16
  • I think the status icon is brought by the `indicator plugin` of a panel. Remove this plugin and the status icon will disappear... along with all possibly useful indications, I guess. –  Dec 29 '14 at 16:30
  • @Nasha - how can I remove the `indicator plugin`? Do I have to recompile my own `lxpanel` package ? – Martin Vegter Feb 17 '15 at 19:42
  • I have no idea how to do that with LXDE but you don't have to recompile anything. I assume what you're looking for lies somewhere in the bottom panel properties — i.e. the bar at the bottom; under GNOME, those bars are named "panels" and from what I see in your screenshot it looks much like it. Try right clicking the bottom panel and search for "properties" or "settings". Maybe there is also a global "Settings" section in your environment's menu that links to the bottom panel properties. –  Feb 19 '15 at 14:21
  • To say it has _nothing_ to do with dbus is incorrect. The notification daemon (`notify-osd`, `notification-daemon` or others) _listens_ to dbus messages and displays the ones it thinks the user should see. e.g., I can set the `DBUS_SESSION_BUS_ADDRESS` and direct a notification coming from one display onto another display (a VNC session, for example). It is _very_ handy in some of my more interconnected setups. – David Dombrowsky May 22 '18 at 00:32
  • 1
    @DavidDombrowsky the icon itself is a selection of how the system you use decides. Dbus doesn't affect it, as you discovered in your own answer. The icon depends on the notification handler. – Braiam May 22 '18 at 11:28
1

For what it's worth, I had the opposite request. I wanted the list of notifications to show up. Turns out the default in lxde (or maybe ubuntu) is notify-osd, which doesn't show this icon or the history of messages sent by anything, including notify-send.

I switched it to notification-daemon and it does exactly what I want it to do. Not sure how to hack the startup scripts or settings to get lxde to do it automatically, but that's a solvable problem.

  • I am using Lubuntu 18.04 and I would like to get a notification icon with the list of notifications, as I use quite a few software generating notifications which I don't always see right away. I have tryed to install `notification-daemon` but it was already installed so nothing changed. Any other ideas on how to activate an icon with a notifications list ? – ComputingFroggy May 20 '19 at 10:03
  • It's possible that the default notification handler is grabbing them. I had to make sure that all others (e.g. `notify-osd`) were REMOVED from the system, and then `notification-daemon` seems to work automatically. It shows the history of notifications also, which is nice. – David Dombrowsky May 21 '19 at 12:58
  • It was `xfce4-notifyd` that was running and it did not get listed by the command `apt-cache search notification | grep daemon | grep notification` as the text is in translated in French (I am running LXDE in French). I eventually found it and removed it (and killed it). I installed `notification-daemon` and started it manually with `/usr/lib/notification-daemon/notification-daemon start` and it works fine now ! – ComputingFroggy May 31 '19 at 15:14
  • I will see after next reboot if it does not start automagically, I will add it to the autostart apps in `/etc/xdg/autostart`. – ComputingFroggy May 31 '19 at 15:20
-3

Use the --icon= flag with a path to a transparent image. Combine that with the short timeout and you don't see anything.

  • No, [the `--icon=` option](http://www.thegeekstuff.com/2010/12/ubuntu-notify-send/) is for the icon *within* the tooltip. –  Dec 29 '14 at 16:22