Last active
February 16, 2018 12:44
-
-
Save unhammer/01c65597b5e6509b9eea to your computer and use it in GitHub Desktop.
a wrapper around `make' to interrupt you when you start procrastinating
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
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