.zsh/functions/precmd_maybe_festival
This commit is contained in:
parent
1ccf9858e7
commit
83c71c18d7
1 changed files with 15 additions and 0 deletions
15
.zsh/functions/precmd_maybe_festival
Normal file
15
.zsh/functions/precmd_maybe_festival
Normal 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
|
Loading…
Reference in a new issue