Make notifications transient if successful

This commit is contained in:
Grafcube 2023-04-04 12:38:28 +05:30
parent 1f64cb6544
commit 8418a6e3b2
No known key found for this signature in database
GPG key ID: E383688F2878A440

View file

@ -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' \