Sometimes we need to send a message to a remote user. We can display messages on our local desktop using Notify OSD, but we are unable to send a message to the remote user's desktop.
We tried the following:
ssh user@remote
notify-send message
-> Sends message to the local display but not to the remote.
ssh admin@remote
sudo -u user "notify-send message"
sudo: notify-send user: command not found
-> There was a command not found error.
ssh -X user@remote "DISPLAY=:0 notify-send message"
-> Again sends the message to my local box only.
Is there any way to send a message to the remote desktop?
Have you tried
ssh user@host 'DISPLAY=:0 notify-send "TEST MESSAGE."'
Answer taken from ubuntuforums.org/showthread.php?t=1240828 (without the
-X
option as suggested by jjmontes)