Skip to content

Instantly share code, notes, and snippets.

@brianarn
Last active May 24, 2018 21:21
Show Gist options
  • Save brianarn/62b47c155bb72699aa7daa592ada7c14 to your computer and use it in GitHub Desktop.
Save brianarn/62b47c155bb72699aa7daa592ada7c14 to your computer and use it in GitHub Desktop.

Revisions

  1. brianarn revised this gist May 24, 2018. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion README.md
    Original 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.
    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.
  2. brianarn created this gist May 24, 2018.
    14 changes: 14 additions & 0 deletions README.md
    Original 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.