Revisions
-
aehlke revised this gist
May 26, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ growl_about_long_running_commands() { max=${PREEXEC_MAX:-10} if [ $elapsed -gt $max ]; then growlnotify --image="$img" -n "LongRunningCommandGrowler" -m "exited with status $exitstatus after $elapsed secs" ${PREEXEC_CMD:-Some command} fi PREEXEC_TIME= PREEXEC_CMD= -
jamesmacaulay revised this gist
Mar 9, 2011 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ preexec_functions+='save_preexec_time' save_preexec_time() { export PREEXEC_CMD="$(history $HISTCMD | sed 's/ *[0-9]* *//')" export PREEXEC_TIME=$(date +'%s') } @@ -24,4 +24,7 @@ growl_about_long_running_commands() { if [ $elapsed -gt $max ]; then growlnotify -H localhost --image="$img" -n "LongRunningCommandGrowler" -m "exited with status $exitstatus after $elapsed secs" ${PREEXEC_CMD:-Some command} fi PREEXEC_TIME= PREEXEC_CMD= } -
jamesmacaulay revised this gist
Mar 8, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ # long-running command growler # hooks for zsh, built on bash version at http://hints.macworld.com/article.php?story=20071009124425468 preexec_functions+='save_preexec_time' save_preexec_time() { -
jamesmacaulay created this gist
Mar 8, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ # long-running command growler preexec_functions+='save_preexec_time' save_preexec_time() { export PREEXEC_CMD="$(history $HISTCMD)" export PREEXEC_TIME=$(date +'%s') } precmd_functions+='growl_about_long_running_commands' growl_about_long_running_commands() { exitstatus=$? if [ $exitstatus -eq 0 ]; then img="$HOME/.zsh/images/pass.png" else img="$HOME/.zsh/images/fail.png" fi stop=$(date +'%s') start=${PREEXEC_TIME:-$stop} let elapsed=$stop-$start max=${PREEXEC_MAX:-10} if [ $elapsed -gt $max ]; then growlnotify -H localhost --image="$img" -n "LongRunningCommandGrowler" -m "exited with status $exitstatus after $elapsed secs" ${PREEXEC_CMD:-Some command} fi }