Skip to content

Instantly share code, notes, and snippets.

@textgoeshere
Created October 4, 2011 21:31
Show Gist options
  • Save textgoeshere/1262881 to your computer and use it in GitHub Desktop.
Save textgoeshere/1262881 to your computer and use it in GitHub Desktop.
quick and dirty script to "growl" notify outcome of long-running command
#!/bin/bash
# create an array from the params
declare -a CMD=($*)
# execute the command given by the params
${CMD[@]}
# notify the outcome given by the exit code
if [ $? == 0 ]
then
notify-send "${CMD[0]} passed" -i gtk-dialog-info
else
notify-send "${CMD[0]} failed" -i gtk-dialog-error
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment