
I am trying to find a way to send a message (like a popup message) from 1 PC to another. One machine is Linux (Ubuntu 10.04) and the other one is a server running OpenBSD or FreeBSD. I wanted to be able to have some scripts run and notify me when they were done. After searching for a little while I finally ran across a post on www.barregren.se. He goes into pretty good detail about the things that you can do with the notify program. The first step to getting access to the pop-ups (aka Notify OSD) is to install the program notify-send. So from the command line enter the following.
sudo apt-get install libnotify-binNow from the command line let’s try a couple of quick things.
notify-send 'Hello World'The next thing I wanted to do was to have some kind of a title for the pop-up. Here is how that works
notify-send 'Title Goes Here' 'The message goes here. If it is a very long message then the message should wrap onto the next line(s).'The next thing that you may want to do is to put things on multiple lines. The easiest way that I saw on barregren.se was to use the echo command.
notify-send "Title" "$(echo -e "This is the first line.nAnd this is the second.")"The following doesn’t work. It all stays on one line.
notify-send "n doesn't work""This is the first line.nAnd this is the second."Finally you may want to add icons to your messages.
notify-send -i /usr/share/pixmaps/gnome-irc.png "Demonstration""This is a desktop notification from the command line."Well there you have it. Now you can add pop-up notifications to your scripts.
ssh [email protected] "export DISPLAY=:0.0; notify-send 'Message from server' 'Backup Started' "This command will send a message (like a popup message) from 1 PC to another. Command tested under OpenBSD, FreeBSD and Linux of course.