Created
March 11, 2013 22:10
-
-
Save crowding/5138330 to your computer and use it in GitHub Desktop.
if a command takes longer than some timeout, say "I'm done"
This file contains hidden or 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
#.bash_profile | |
TIMEOUT=10 | |
function speak_if_long { | |
last_command_time=$(HISTTIMEFORMAT="%s " history 1 | awk '{print $2}') | |
if (( $(date -u +"%s") - $last_command_time > $TIMEOUT )) | |
then | |
say "I'm done" | |
fi | |
} | |
PROMPT_COMMAND="speak_if_long" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment