Skip to content

Instantly share code, notes, and snippets.

@eli-oat
Created April 10, 2020 21:11
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 eli-oat/7f2d03d49fb9756b7b2527843e1c5b90 to your computer and use it in GitHub Desktop.
Save eli-oat/7f2d03d49fb9756b7b2527843e1c5b90 to your computer and use it in GitHub Desktop.
macOS bash function to trigger an alert when a process completes
watch(){
cmd=$@ # Somehow interpolate $@ directly doesn't work.
$@ && tput bel && osascript -e "display notification \"Completed: $cmd\" with title \"╚(•⌂•)╝ Watch Alert\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment