Merge pull request #41 from Grafcube/transient-on-success

Make notifications transient if successful
This commit is contained in:
Michael Aquilina 2023-04-27 16:47:46 +01:00 committed by GitHub
commit 71e8da986f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,10 +51,12 @@ function _auto_notify_message() {
if [[ "$platform" == "Linux" ]]; then if [[ "$platform" == "Linux" ]]; then
local urgency="normal" local urgency="normal"
local transient="--transient"
if [[ "$exit_code" != "0" ]]; then if [[ "$exit_code" != "0" ]]; then
urgency="critical" urgency="critical"
transient=""
fi 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 elif [[ "$platform" == "Darwin" ]]; then
osascript \ osascript \
-e 'on run argv' \ -e 'on run argv' \