diff options
Diffstat (limited to '.zsh/functions')
-rw-r--r-- | .zsh/functions/Makefile | 7 | ||||
-rw-r--r-- | .zsh/functions/precmd_maybe_festival | 15 | ||||
-rw-r--r-- | .zsh/functions/preexec_update_vars | 3 |
3 files changed, 25 insertions, 0 deletions
diff --git a/.zsh/functions/Makefile b/.zsh/functions/Makefile new file mode 100644 index 0000000..670c57c --- /dev/null +++ b/.zsh/functions/Makefile @@ -0,0 +1,7 @@ +DESTDIR:=$(DESTDIR)/functions +objects=chpwd_show_todo chpwd_update_git_vars env get_cnt line \ + precmd_maybe_festival precmd_update_git_vars precmd_update_updates \ + preexec_update_vars prompt prompt_git_info rprompt \ + update_current_git_vars welcome + +include ../../dotfiles.mk diff --git a/.zsh/functions/precmd_maybe_festival b/.zsh/functions/precmd_maybe_festival new file mode 100644 index 0000000..3f8baa3 --- /dev/null +++ b/.zsh/functions/precmd_maybe_festival @@ -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 diff --git a/.zsh/functions/preexec_update_vars b/.zsh/functions/preexec_update_vars index 105d240..f8c1b44 100644 --- a/.zsh/functions/preexec_update_vars +++ b/.zsh/functions/preexec_update_vars @@ -11,3 +11,6 @@ case "$1" in __EXECUTED_PACMAN_COMMAND=1 ;; esac + +__COMMAND_EXEC_TIME=$(date +%s) +__COMMAND_EXECUTING=1 |