Skip to content

Instantly share code, notes, and snippets.

@OrangeTux
Created January 19, 2015 11:52
Show Gist options
  • Save OrangeTux/5cd6f3d53f8c8d75dcdd to your computer and use it in GitHub Desktop.
Save OrangeTux/5cd6f3d53f8c8d75dcdd to your computer and use it in GitHub Desktop.
Notification function. Add it to your .zshrc.
# Send notification when command has finished.
# Usage:
# n <command>
#
# Lets say you want to build something that takes a certain time:
# n make
n() {
"$@"
RETVAL=$?
URGENCY="normal"
[ $RETVAL -ne 0 ] && URGENCY="critical"
notify-send -u $URGENCY -t 10000 "Command '$@' has finished"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment