.zsh/functions/precmd_maybe_festival

This commit is contained in:
Tom Willemsen 2012-11-28 10:18:12 +01:00
parent 1ccf9858e7
commit 83c71c18d7

View file

@ -0,0 +1,15 @@
cmdstatus=$?
if [ -n "$__COMMAND_EXECUTING" -a $__COMMAND_EXECUTING -gt 0 \
-a -n "$__COMMAND_EXEC_TIME" ]; then
__COMMAND_EXECUTING=0
duration=$(expr $(date +%s) - $__COMMAND_EXEC_TIME)
if [ $duration -gt 30 ]; then
if [ $cmdstatus -eq 0 ]; then
echo "done" | festival --tts
else
echo "failed" | festival --tts
fi
fi
fi