Well, Gnome notifications use D-BUS to pass the messages around. The gnome specification describes how to use the
org.freedesktop.Notifications.* classes and has a good deal of formatting tips. In general it is a HTML-ish format.
Yet, you absolutely cannot talk to the D-BUS on another machine remotely. Let's not even start on how many security holes that would open.
Still, you can always have a program on the target machine that will receive the communication and talk to D-BUS locally already in there.
There are two options that are wrappers around
org.freedesktop.Notifications.* and make writing programs much easier:
libnotify: which is almost a de-facto standard for making notifications, supports not only gnome but several others.
notify-sharp-3: as strange as it may sound it is an open-source C# based functionality around several notification specs. At some point it even had its own language called
boo, but it is kind of dying out in favour of
libnotify we go.
libnotify comes with a binary that knows how to talk with the notification daemon (yes, those notifications are displayed by a background daemon). The command is
notify-send, and it is rather trivial to use.
notify-send 'Meeting in 5 minutes' 'John from the <b>QA Team</b> just found a bug that should never had happened. Seriously, we are doing something wrong'
And that will display the notification. Yet, making it remote is a little more complex. Assuming that you know that
bob is the user currently running Xorg at machine
krakatoa and that krakatoa has libnotify installed and is running gnome notify daemon you can do:
ssh bob@krakatoa \
notify-send 'Meeting in 5 minutes' \
'John from the <b>QA Team</b> just found a bug that should never had happened. Seriously, we are doing something wrong'
But finding each user on each machine may be tricky. You may try to create a script that will perform
ps -afe | grep gnome, find the user and run
su -u <user> DISPLAY=:0 notify-send .... But then again, you probably should not send
ssh requests as
root in the first place.
The Arch wiki has a list of interfaces to
libnotify in several languages. From there you can create your own daemon, with your own communication protocol for the notification messages. For example, since you are specifically after gnome,
python Gobject may just fit the bill.
Notifications happen on D-BUS;
You cannot directly access D-BUS remotely;
You can use
libnotify to access D-BUS from a program under your control on the target machine.