brunobuccolo.com

Be notified of slow shell commands

Quick tip for not losing focus when running slow command-line tasks, such as bundle install or god forbid gem install nokogiri.

After reading this post about an utility to notify you of long running tasks (Linux only), I decided to clone it using just zsh and a ruby gem.

Put this in your .zshrc, .bashrc or equivalent:

function lmk() {
  eval $*
  terminal-notifier -message "Done: $*"
}

This snippet declares a function lmk (let me know) that will execute whatever is passed to it $*, and then use terminal-notifier to show a notification.

Make sure you install terminal-notifier by using:

gem install terminal-notifier
# or
brew install terminal-notifier

Load the lmk function, if not available yet source ~/.zshrc and test it:

lmk sleep 10

You should see something like this:

Awesome, right?

Bruno Buccolo

Follow me on Twitter! @buccolo


© 2011– Bruno Buccolo | Made in São Paulo ☂