notification from command line

I read Lars' wish on Debian Planet today. I such situations I normally use the command line tool "beep" (debian package "beep") to produce an audio notification when the job completes.

If you leave the room for a few minutes you could miss the notification, though, so I can see that a visual reminder would be helpful as well.

This resulting python script is here. I recommend installing "beep" and "python2.3-gtk2" to get full functionality.

It would be nice to put an icon or message in the notification area but it appears that there are no python bindings available for doing this at the moment. However, it appears that this will be available once Gnome 2.10 hits unstable, so I'll plan to add an option for this at that point.

In your .bashrc, I recommend making an alias with your favourite options, such as

$ alias notify='notify -p -b --'
so that you can simply do
$ notify make foo

Update: here's the help:

usage: notify [options] -- command [arg1] [arg2] ...

  -h, --help   show this help message and exit
  -p, --popup  Pop up dialog when command exits
  -b, --beep   Beep PC Speaker when command exits

Posted by Jason Hildebrand <> Saturday May 28, 2005 at 1:07 PM

Zenity is a command line tool that seems to do what you want. It can popup dialogs from command-line, insert notification area icons, file browser dialogs, etc.


zenity --notification --text "Finished compiling"
zenity --info --text "Finished compiling"

It's a debian package, and the FSF Directory entry for Zenity seems about the best link to it.

Hope this helps!

Posted by: Anonymous on Sunday May 29, 2005 at 3:40 AM

Instead of making a pythin script why not use xmessage to display a simple dialog box? Regards, Deboo

Posted by: Deboo on Wednesday May 30, 2007 at 11:36 PM