Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Recently, I've started to use Karma as my JavaScript testing service. It works quite good, but everytime the tests are run, the results will be displayed in the terminal that has started the Karma Runner.
I would like to change the output location to the Unity notification (notify-send) but I don't know how to do this.
Also a test like echo 'hi' > notify-send is not working.
Thanks for your help in advance.

share|improve this question
up vote 1 down vote accepted

There are several ways you could do it. If you wanted everything in a single notification it would be as simple as:

notify-send "Summary" "$(command)"

Replacing command with echo "hello" or your karma command, or whatever.

You could also do one line per notification, if each test result were on a line, such as:

command | while read line; do notify-send "Summary" "$line"; done

Possibly with a sleep 1 in there to avoid flooding the notifications, although without some app to collect the notifications, that may be a bit difficult to follow. You could also use a similar command to collect together several lines before displaying the notification.

share|improve this answer

Your Answer


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.