Jay Jay - 1 year ago 115
Linux Question

Show image notification from bash script

What I'm trying to accomplish:
On Ubuntu 10.04 I'd like to display a small notification image in the corner of the screen and have the image fade out. I'd like to do it from the command line for use with bash scripts. Similar to "notify-send", "zenity", or "dialog" except
it displays images as well.

What I've found so far:
ImageMagick animate seems to be the only command line tool that can display an image and exit without user interaction.

Is there anything any better? I could write one myself but I thought there should already be something to do this.

Answer Source

gcin does the work. It shows full size images as notifications.

sudo apt-get install gcin
gcin-message -icon your_image.jpg

Extract of man gcin-message:

       gcin-message - gcin's notification tool

       gcin-message [-icon file] [-text string] [-duration milliseconds]

       gcin-message  displays notification image and/or text. It is useful for
       filters to have interaction with users.

       -icon file
              Display an image.

       -text string
              Display text string. The space character is not allowed.

       -duration milliseconds
              Time to show notifications.

However I suggest you to not use this tool, because its installation from the Ubuntu repository is not fine grained (6 MB of stuff and a chinese icon in the notification area).

See if you can get gcin-message out of the gcin package and put it into your own package (if this suits your needs).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download