From 1c2a8b12b1f69978262ad56229238775a4d4bcfd Mon Sep 17 00:00:00 2001 From: Dihak Date: Mon, 22 Feb 2021 16:16:07 +0700 Subject: [PATCH] feat: add ignore subcommand feature --- README.rst | 2 +- ntfy/shell_integration/auto-ntfy-done.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a3d6789..58d5ffb 100644 --- a/README.rst +++ b/README.rst @@ -75,7 +75,7 @@ listed in ``AUTO_NTFY_DONE_IGNORE`` don't generate notifications. For example: .. code:: shell - export AUTO_NTFY_DONE_IGNORE="vim screen meld" + export AUTO_NTFY_DONE_IGNORE="vim screen meld 'npm run dev' 'npm run watch'" Extras ~~~~~~ diff --git a/ntfy/shell_integration/auto-ntfy-done.sh b/ntfy/shell_integration/auto-ntfy-done.sh index 9c57bc4..f9a5c74 100644 --- a/ntfy/shell_integration/auto-ntfy-done.sh +++ b/ntfy/shell_integration/auto-ntfy-done.sh @@ -19,7 +19,7 @@ function _ntfy_precmd () { ntfy_start_time='' local appname=$(basename "${ntfy_command%% *}") - [[ " $AUTO_NTFY_DONE_IGNORE " == *" $appname "* ]] && return + [[ " $AUTO_NTFY_DONE_IGNORE " == *" $appname "* || " $AUTO_NTFY_DONE_IGNORE " == *"'$ntfy_command'"* ]] && return (ntfy $AUTO_NTFY_DONE_OPTS done \ $AUTO_NTFY_DONE_UNFOCUSED_ONLY $AUTO_NTFY_DONE_LONGER_THAN \