diff options
author | Tom Willemsen | 2012-12-05 00:44:09 +0100 |
---|---|---|
committer | Tom Willemsen | 2012-12-05 00:44:09 +0100 |
commit | 6278e2e634b05027d31220afd328a9f7fe77c6f1 (patch) | |
tree | 3dbec6a3880ca980694def0d737a477b68254691 /.zsh/functions | |
parent | fa717d86a07d009ab324a40cd8dbf539e61a9da3 (diff) | |
parent | 15adc911da3f5b527c74b6bb67d677898d6a173e (diff) | |
download | dotfiles-6278e2e634b05027d31220afd328a9f7fe77c6f1.tar.gz dotfiles-6278e2e634b05027d31220afd328a9f7fe77c6f1.zip |
Merge remote-tracking branch 'origin/master' into phoenix
Conflicts:
.emacs.d/site-lisp/oni.el
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 |