Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a custom script and I want to send a desktop notification (the one that appears in the top right corner of the screen) with a custom message. How do I do that?

share|improve this question

3 Answers 3

up vote 42 down vote accepted

There is bunch of other cool features with notify-send

We can run a command and make it display in the notification:

notify-send <title> <`command`>
notify-send Date "`date`"
notify-send Disk "`df / -H`"

We can use icons with the notifications

notify-send -i <icon> <Message>
notify-send -i face-wink "Hello! January"

Really annoying pop up

notify-send  -t 0 "Bringing down the system"

and

notify-send <title> <message>
notify-send "who am i" "I am January"

For more options check here

share|improve this answer
    
Thank you. Where can we get a list of icons, e.g. the face-wink that you used? –  Paddy Landau Sep 24 '12 at 10:56
1  
check out my answer here –  devav2 Sep 24 '12 at 13:07
1  
Thank you! I now have an extra set of useful knowledge. –  Paddy Landau Sep 24 '12 at 16:37

I stumbled upon that one by chance. Answer: use the program notify-send:

notify-send "Hello world!"
share|improve this answer

Just to add to the other answers, when running the command locally from cron, I use

DISPLAY=:0.0 /usr/bin/notify-send "TITLE" "MESSAGE"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.