Skip to content

Instantly share code, notes, and snippets.

@unhammer
Last active February 16, 2018 12:44
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unhammer/01c65597b5e6509b9eea to your computer and use it in GitHub Desktop.
Save unhammer/01c65597b5e6509b9eea to your computer and use it in GitHub Desktop.
a wrapper around `make' to interrupt you when you start procrastinating
make ()
{
start=$(date +%s);
command make "$@"
ret=$?
if [[ ${ret} -eq 0 ]]; then
icon=checkbox;
else
icon=computer-fail;
fi;
nl='
';
ive_switched_to_hacker_news=4;
if command -V notify-send &> /dev/null && [[ $(( $(date +%s) - ${start} )) -gt ${ive_switched_to_hacker_news} ]]; then
notify-send 'Done compiling, back to work:' "${nl}$(hostname):${nl}$(pwd)" --icon=${icon} --expire-time=15000;
fi
return ${ret}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment