Skip to content

Instantly share code, notes, and snippets.

@flaneur2020
Created November 3, 2012 02:25
Show Gist options
  • Select an option

  • Save flaneur2020/4005555 to your computer and use it in GitHub Desktop.

Select an option

Save flaneur2020/4005555 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Copyright: TualatriX <tualatrix@gmail.com> GPL v3
#
# Website: http://imtx.cn/archives/1516.html
#
# Please add the following line to ~/.bashrc to enable the bash completion support
#
# complete -o filenames -F _root_command notify
KERNEL=`uname -s`
if [ $KERNEL == 'Linux' ]; then
$* && \
notify-send "Cool~ \"$*\" finished!" -i 'emblem-cool' || \
notify-send "Oh No! \"$*\" failed!" -i 'emblem-ohno'
elif [ $KERNEL == 'Darwin' ]; then
# gem install terminal-notifier (OS X 10.8 only)
$* && \
terminal-notifier -message "Cool~ \"$*\" finished!" || \
terminal-notifier -message "Oh No! \"$*\" failed!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment