julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

Option to read line-by-line instead of to eof, and possibly with filter #112

Open mariusk opened 9 years ago

mariusk commented 9 years ago

This will allow output from "watch" type tools (e.g. watchify) that does automatic rebuilding when files change, and would allow a notification every time a compile is done. Adding a filter that only notifies if it finds a certain keyword would allow notifications only on errors etc.

julienXX commented 9 years ago

@mariusk You could use standard UNIX tools for the filter part like $ command | grep word | terminal-notifier -message

mariusk commented 9 years ago

Absolutely, that I know, the problem is terminal-notifier waits for EOF before doing anything, which means in this context while grep is able to filter, terminal-notifier will not do anything until the pipe is closed (command finishes, which watchify never does of course).