Created
December 11, 2019 09:00
-
-
Save kitt1987/267c0f12690a5aa0bee3a19470a753a5 to your computer and use it in GitHub Desktop.
Show notification after executing shell commands.
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
yell() { | |
cmd="" | |
if [ $# -gt 0 ]; then | |
cmd=$@ | |
else | |
cmd=$(history| awk '{$1=""; print $0}' | grep -E '^\s*yell.+' | tail -1) | |
fi | |
eval $cmd | |
if [ $? -ne 0 ]; then | |
terminal-notifier -title '💀' -message "Done- $(echo $cmd) [$(basename `pwd`)]" -sound default | |
else | |
terminal-notifier -title '👽' -message "Done- $(echo $cmd) [$(basename `pwd`)]" -sound default | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment