Skip to content

Instantly share code, notes, and snippets.

@crowding
Created March 11, 2013 22:10
Show Gist options
  • Save crowding/5138330 to your computer and use it in GitHub Desktop.
Save crowding/5138330 to your computer and use it in GitHub Desktop.
if a command takes longer than some timeout, say "I'm done"
#.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