Maybe this is answered somewhere else, but I didn't see it.
I am running Ubuntu 14.04. When I SSH into my machine, for example:
ssh <user>@<machineip> notify-send "Hello"
I don't see anything on the monitor where I am logged into the machine.
If I prefix notify-send
with DISPLAY=:0.0
or DISPLAY=:0
nothing different happens. I just never see any notification on the current session.
Is there some trick/switch to getting this working?
In case this isn't clear, allow me to reiterate:
From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.
Best Answer
I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the
excerpt$DISPLAY
is how X11 sends the output from an application to another for displaying purposes, but thenotify-send
is sending an actual message to the notification daemon. This message is send using thelibnotify
library.Source: https://developer.gnome.org/libnotify/
Per app approach
One method for joining the
notify-send
messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.Tunneling libnotify over SSH
For a more general solution
excerptlibnotify-over-ssh
may be more what you're looking for.Displaying on the remote server
If on the otherhand you're simply trying to use
notify-send
to display messages on a remote server that you've usedssh
to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.To get
notify-send
working I had to set this variable with the appropriate value from the remote system's desktop environment.On my system I was able to make use of a file that's maintained for this exact purpose.
NOTE: The name of the DBUS file will change from session to session.