Ubuntu 9.04 Notifications from the Command line

I've been using Bonjour chat for Home automation updates - When someone calls, a chat box will appear with the caller id info.
But Bonjour chat isn't working in Ubuntu 9.04 - It crashes Pidgin.

So why not use the slick new notification system?

UPDATE: No need for python - Thanks, Jim!
Just use:

$ notify-send -i "phone" "Incoming Call" "`printf "Jimmy Bean\n111-222-3333"`"

Output of notify-send --help

Usage:
  notify-send [OPTION...] <SUMMARY> [BODY] - create a notification

Help Options:
  -?, --help                        Show help options

Application Options:
  -u, --urgency=LEVEL               Specifies the urgency level (low, normal, critical).
  -t, --expire-time=TIME            Specifies the timeout in milliseconds at which to expire the notification.
  -i, --icon=ICON[,ICON...]         Specifies an icon filename or stock icon to display.
  -c, --category=TYPE[,TYPE...]     Specifies the notification category.
  -h, --hint=TYPE:NAME:VALUE        Specifies basic extra data to pass. Valid types are int, double, string and byte.
  -v, --version                     Version of the package.

AttachmentSize
notify.py.txt740 bytes

Comments

As a standalone script, you

As a standalone script, you have re-invented the wheel 'notify-send' found in the libnotify-bin package.

However, as a code snippet to be included in a Python application, you have saved a potentially unsafe system call :-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options