-
-
Save edderrd/7344630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# finished: a quick script to notify you when a command is done using Mountain Lion notifications | |
# It grabs the current folder as the title and takes one argument as the message | |
# Example: make && make install && finished "Done compiling" || finished "compiler failed" | |
# | |
# Needs the terminal-notifier gem : `gem install terminal-notifier` | |
# Can alternately be used with the CLI <https://github.com/alloy/terminal-notifier> | |
# (remove require block below and swap comment lines at the bottom) | |
require 'rubygems' | |
require 'terminal-notifier' | |
message = ARGV[0] || "Task completed" | |
project = Dir.pwd.split('/')[-3..-1].join('/') | |
activate = 'com.googlecode.iterm2' | |
TerminalNotifier.notify(message, :activate => activate, :title => "Finished in #{project}", :sender => "com.googlecode.iterm2") | |
# %x{/usr/bin/terminal-notifier -message "#{message}" -title "Finished in #{project}" -activate #{activate}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed sender issue in Mavericks