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.

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

1 Answer 1

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

 
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.