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

How can I write, from a bash script, to KDE's OSD or notification area? I am using KDE 4.5, and basically what I want is my script to report some stuff when it is run. Since I run the script by a shortcut, I have no console output, but I would like to write to OSD on notification area.

I know about, and use, "osd_cat" but that just puts some ugly text on the screen.

Thanks.

share|improve this question
    
Usually, the answer to "How … kde4 … from the shell" starts with qdbus. I would expect something like qdbus org.kde.knotify /Notify event "notice" "my script" '(' ')' "title" "body" 0 '(' ')' 1000 0 to work, but it produces no visible effect on my Ubuntu 10.04 kde 4.4.2. – Gilles Aug 12 '10 at 9:13
    
By the way, this is what passes for the API documentation: api.kde.org/4.x-api/kdebase-runtime-apidocs/knotify/html/… – Gilles Aug 12 '10 at 9:15
up vote 13 down vote accepted
notify-send 'why hello there'

notify-send is part of the package libnotify-tools.


perl -MDesktop::Notify -e'Desktop::Notify->new->create(body => q{why hello there})->show'

Desktop::Notify is available on CPAN.

share|improve this answer
    
unfortunately, it's no longer a part of libnotify4 :-/ kdialog below still works. This is not a fault of daxim, just KDE's shifting libraries... – mike Feb 11 '14 at 12:26

As an alternative:

kdialog --passivepopup 'why hello there' 5

5 is the number of seconds it will last.
Run kdialog --help for other options, like title.

share|improve this answer
1  
Don't even need to install any additional packages, and has all the options you would need, great! :-) – timss Mar 9 '14 at 20:26

You must log in to answer this question.

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