Thanks to a wonderful tip from @brianloveswords I've started using osascript
alongside say
to help me notice when long-running jobs are done.
You can also put a sound with the notification, which is cool, and I wanted a quick way to test every sound on the system, so I ran this:
for f in /System/Library/Sounds/*.aiff
do
file=$(basename -s .aiff $f)
osascript -e "display notification \"$file\" with title \"$file\" sound name \"$file\""
sleep 1
done
It cycles through each sound, creating a notification, with a title, so you can get a taste of all the options available to you.
I also just created this small bash function that I'm now using in some scripts around this, to do both a say and an alert at me.
announce() {
osascript -e "display notification \"$1\" with title \"APP NAME HERE\" sound name \"Glass\""
say $1
}
Now I can announce "Thing complete"
in the script and it works.