From 8418a6e3b243efa3ad2514ffd3144667117d5bbc Mon Sep 17 00:00:00 2001 From: Grafcube Date: Tue, 4 Apr 2023 12:38:28 +0530 Subject: [PATCH 1/2] Make notifications transient if successful --- auto-notify.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index 3fc0ae2..a60191d 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -51,10 +51,12 @@ function _auto_notify_message() { if [[ "$platform" == "Linux" ]]; then local urgency="normal" + local transient=--transient if [[ "$exit_code" != "0" ]]; then urgency="critical" + transient="" fi - notify-send "$title" "$body" --app-name=zsh "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" + notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" elif [[ "$platform" == "Darwin" ]]; then osascript \ -e 'on run argv' \ From 9a9f8f21bb698adbb6ebaf1831922ed805d5caec Mon Sep 17 00:00:00 2001 From: Grafcube Date: Thu, 27 Apr 2023 21:11:22 +0530 Subject: [PATCH 2/2] Quote transient --- auto-notify.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index a60191d..118af69 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -51,12 +51,12 @@ function _auto_notify_message() { if [[ "$platform" == "Linux" ]]; then local urgency="normal" - local transient=--transient + local transient="--transient" if [[ "$exit_code" != "0" ]]; then urgency="critical" transient="" fi - notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" + notify-send "$title" "$body" --app-name=zsh "$transient" "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" elif [[ "$platform" == "Darwin" ]]; then osascript \ -e 'on run argv' \