Last active
May 24, 2018 21:21
-
-
Save brianarn/62b47c155bb72699aa7daa592ada7c14 to your computer and use it in GitHub Desktop.
Revisions
-
brianarn revised this gist
May 24, 2018 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,15 @@ 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. ```bash 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. -
brianarn created this gist
May 24, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ Thanks to a [wonderful tip from @brianloveswords](https://twitter.com/brianloveswords/status/997188051096035328) 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: ```bash 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.