Skip to content

Instantly share code, notes, and snippets.

@jjb
Last active February 1, 2019 15:53
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 jjb/1b3c5075a77e70fedd4b3367da2d1342 to your computer and use it in GitHub Desktop.
Save jjb/1b3c5075a77e70fedd4b3367da2d1342 to your computer and use it in GitHub Desktop.

alert shell function

I keep mine in .zshrc. It could probably also be a standalone script named "alert" with chmod 755 (i think?) in ~/bin

# examples:
#   git push heroku master ; alert
#   bundle install ; alert
function alert {
  if (( $? == 0 )) then
    unicornleap --seconds 3 > /dev/null &
    say -v Daniel 'successfully done!'
  else
    unicornleap --unicorn ~/.unicornleap/poop.png --seconds 3 > /dev/null &
    say -v Karen 'failed.'
  fi
}

dependencies

  1. install unicornleap https://github.com/jgdavey/unicornleap
  2. pick whatever png you want for ~/.unicornleap/poop.png
  3. I also have sparkle.png and unicorn.png, I'm not sure if they are used by default by unicornleap or if they were part of something I was experimenting with

Here's the contents of my ~/.unicornleap: https://cl.ly/9c9d82f50d6c

simpler approaches

git push heroku master; say 'the push is done'
git push heroku master; osascript -e 'tell app "System Events" to display dialog "the push is done"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment