Skip to content

Instantly share code, notes, and snippets.

@staltz

staltz/.bashrc

Created Mar 7, 2017
Embed
What would you like to do?
Show a macOS notification when a terminal task is done
# Name it whatever you want. I like `y` because in my keyboard layout it's close to `;`
function y() {
previous=$?
if [ $previous -eq 0 ]; then
osascript -e "display notification \"Done\" with title \"Terminal Task\"" && say "it is done";
else
osascript -e "display notification \"Failed\" with title \"Terminal Task\"" && say "it went to the trees";
fi
}
npm test ;y
@sebinsua

This comment has been minimized.

@zhangchiqing

This comment has been minimized.

Copy link

@zhangchiqing zhangchiqing commented Mar 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment