Skip to content

Instantly share code, notes, and snippets.

@kessler
Created January 1, 2019 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kessler/636b5de2b97fdd3a33c9a8ca1707c91d to your computer and use it in GitHub Desktop.
Save kessler/636b5de2b97fdd3a33c9a8ca1707c91d to your computer and use it in GitHub Desktop.
get notified when a command completes on osx
#!/bin/bash
# usage: cmd | osa_notify.sh
/usr/bin/osascript 3<&0 <<'APPLESCRIPT'
on run argv
set stdin to do shell script "cat 0<&3"
display notification stdin with title "osa_notify" sound name "Default"
return stdin
end run
APPLESCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment