Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Most of the application can show nicely formatted notification on events that appear on top right corner of the screen. I'm about to write a bash script that will do fairy long processing in the background and I really want to know when it is finished. How can I show that nice notification from a bash script?

share|improve this question
up vote 74 down vote accepted

If you're using the new notification system in Jaunty, you want the notify-send command

notify-send - a program to send desktop notifications


With notify-send you can sends desktop notifications to the user via
a notification daemon from the command line.  These notifications can be
used to inform the user about an event or display some form of information
without getting in the user's way.


-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.
share|improve this answer
Thanks, just found it myself :) apt-get install libnotify-bin have to be run before to get it. – vava Aug 29 '09 at 10:39
How does the root user send a message from crons, init.d, etc? – Lance Caraccioli Nov 22 '13 at 4:38
Eg: notify-send Test "Hello World" – Thaha kp Jun 4 '14 at 8:26
The --expire-time parameter does not work on Ubuntu thanks to this "feature" (bug). – axiopisty Apr 18 at 15:43

Found another way, through Zenity

echo 'message:hi' | zenity --notification --listen

(This also has the benefit of already being installed on Ubuntu.)

share|improve this answer

For KDE users:

$ kdialog --title "Long process completed!" --passivepopup "This popup will disappear in 5 seconds" 5 &
share|improve this answer
Is it possible to set an icon for the notification? – Malabarba May 14 '12 at 4:18

There's also xmessage that will pop-up a window, so it should work on any X11 system.

Pro: It also allows interactively prompting the user with buttons.

Con: Like any pop-up alert, it typically receives focus, so if you're in the middle of typing it can disappear before you read the message.

share|improve this answer
Con: It looks ugly as hell, and also is a super tiny window which is not always obvious to the user. Anyways, it is universal though. :) – Nik Reiman May 6 '13 at 11:37
xmessage doesn't work in Fedora though. Its not installed by default. – Abhay Mittal Jun 3 '14 at 16:47

In a shell script, you can also call the osd_cat utility from libxosd.

share|improve this answer
This is a little bit different as it doesn't use ubuntu desktop notifications. – vava Aug 29 '09 at 13:43
Yes, this is an alternative that you can use with any Linux distribution and any WM/DE. – geek Aug 30 '09 at 13:39

There exists a cross-platform solution called Yfiton:

$ yfiton -n desktop -Pmessage="Lunch time!" -Pposition=TOP_RIGHT
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .