1

yad notifications (https://sourceforge.net/p/yad-dialog/wiki/NotificationIcon/) like in this example are not displayed:

yad --notification --image="gtk-help" --command="echo 'Hello World'" --text="The notification's tooltip"

I guess it has to do with gnome shell. How can I show the yad notification?

GNOME Shell 3.34.1 Ubuntu 19.10

I used gnome tweaks to enable Ubuntu Appindicators to no effect.

phobic
  • 175
  • 1
  • 10
  • I am currently using https://github.com/p-e-w/argos, a gnome shell extension which accomplishes the same thing. But yad is a great tool in general, and seems more simple, so I am interested in getting it to work. – phobic Jan 26 '20 at 10:56
  • Sure the syntax of your command is right? For me, the command hangs the termnal. – vanadium Jan 26 '20 at 11:12
  • Is this a default Ubuntu session or a Gnome session? – vanadium Jan 26 '20 at 11:21
  • @vanadium Thanks for giving it a try. Pretty sure it is correct. I expect the command to run indefinitely as it is supposed to display an app indicator as long as it is running. – phobic Jan 26 '20 at 11:23
  • @vanadium Not quite sure where you are going with this. I am not an expert on session managers, but I guess that I am using a gnome shell extension is not sufficient evidence? It says in the about dialogue that I am using Gnome 3.34. Please provide some guidance if that does not answer your question. – phobic Jan 26 '20 at 11:41
  • It is OK, I also tried with the default Ubuntu session where tray icons are enabled by default (I use a standard gnome session), and it also does not work. Probably, yad uses an old mechanism of tray icons that has been obsoleted both in Gnome Shell and Unity (and possibly other desktops) because that became the Wild West, so I guess you will need other approaches (such as Argos). See here: https://ubuntu.com/blog/notification-area for comments about the legacy tray icons. – vanadium Jan 26 '20 at 14:58
  • @vanadium Feel free to add this as an answer. I will accept it if there are no solutions in the next week. – phobic Jan 26 '20 at 15:05

2 Answers2

2

The classical "system tray" where any application could create an icon has been deprecated in various desktops since 2010. See https://ubuntu.com/blog/notification-area. A more standard notification system has been retained, where applications could, through dbus, create a notification in the notification area that acts in a more standard way for all applications.

Up to version 2.26, Gnome had a "legacy tray" area as a pop out in the bottom corner that could host such icons. Then, Gnome Shell developpers got rid of it all together. Yet, Gnome ShellExtensions such as Topicons Plus and KStatusNotifierItem/AppIndicator Support (used also in Ubuntu desktop as the "Ubuntu appindicators" extension) brought these notification icons back to the topbar. However, application icons have disappeared.

yad for its --notification option may rely on the old mechanism that is now obsolete. Therefore, the option does not work anymore on Unity desktop or Gnome Shell, even with the KStatusNotifierItem/AppIndicator enabled.

Still, the Excellent Gnome Shell extension Argos allows you to create interactive indicators in your top bar. Alternatively, use the notification system instead. In the shell, notifications can be created using notify-send.

vanadium
  • 82,909
  • 6
  • 116
  • 186
1

The gnome shell extension Topicons plus allow us to show icon from yad --notification https://extensions.gnome.org/extension/1031/topicons/

NicolasSmith
  • 981
  • 2
  • 7
  • 21