Functionality comparison
zenity --notification is equivalent to notify-send for the most simple cases.
For example, these two commands are equivalent:
$ zenity --notification --text=Title
$ notify-send Title
and so are these:
$ notify-send Title 'Long text message'
$ zenity --notification --text='Title\nLong text message'
As you can see, the syntax for notify-send is shorter and simpler, because it is a specialised tool, while --notification is just one of the many commands available in zenity.
Differences are:
notify-send has an expire-time option, which however, according to the current man page, is ignored by both Ubuntu's Osd and the Gnome shell.
zenity has a --listen option which can change the appearance of the notification without closing and reopening it: message displayed, visibility and icon can all be changed by sending appropriate strings to zenity's standard input.
- setting an icon requires just
--icon for notify-send while it requires --listen and icon: error command on standard input for zenity.
- category and urgency are set with dedicated options in
zenity, while they require a --hint option.
Note that you need to explicitly kill the zenity process when using --listen, because it keeps listening on standard input even after it is closed (this is a bug, I suppose). This is not a problem for complex procedures where the notification changes dynamically, but it makes things unnecessarily complex for simple cases.
Also note that the --hint option of zenity is briefly mentioned by zenity --help-notification, but it is not mentioned in the man page.
Both category and urgency are documented in the Desktop Notifications Specification.
Alternatives
dialog and the old whiptail are possible alternatives, but I don't see any advantage in using them for notifications unless you cannot install notify-send or zenity or you are already using them for other purposes, since both have much more functionality than just notifications.
notify-sendby default, but nozenity. – rugk Jul 7 '19 at 18:46