use array argument expansion

This commit is contained in:
Michael Aquilina 2024-05-13 11:11:51 +01:00
parent 43dbc4eb56
commit 6e5a54c5b5
No known key found for this signature in database
GPG key ID: 636066730B056BD1

View file

@ -59,11 +59,13 @@ function _auto_notify_message() {
transient=""
icon=${AUTO_NOTIFY_ICON_FAILURE:-""}
fi
local arguments=("$title" "$body" "--app-name=zsh" "$transient" "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME")
if [[ -n "$icon" ]]; then
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" "--icon=$icon"
else
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME"
arguments+=("--icon=$icon")
fi
notify-send ${arguments[@]}
elif [[ "$platform" == "Darwin" ]]; then
osascript \