diff --git a/utilities/utilities.plugin.zsh b/utilities/utilities.plugin.zsh index d0d5d0a..355a580 100644 --- a/utilities/utilities.plugin.zsh +++ b/utilities/utilities.plugin.zsh @@ -45,7 +45,32 @@ notify() { # Send a desktop notification when long running commands complete. notify_command_threshold=60 +notify_ignore_list=( + git + nvim + ssh + sudo + sudoedit + tmux + vi + vim +) +# TODO: append include any of ${(k)aliases} is they contain any of the above +notify-ignore() { + echo "$1" + for ignore in $notify_ignore_list; do + echo "ignore: $ignore" + if [ "$1" = "$ignore"* ]; then + echo "ignored: $1" + # return 0 + fi + done + # return 1 +} notify-preexec() { + # if notify-ignore $1; then + # return + # fi notify_command_start=`date +%s` notify_command=$1 } @@ -56,6 +81,8 @@ notify-precmd() { if [[ $notify_command_time -gt $notify_command_threshold ]]; then notify "completed: $notify_command" fi + unset notify_command + unset notify_command_start fi } add-zsh-hook preexec notify-preexec