mirror of
https://github.com/philippdieter/zsh-auto-notify.git
synced 2025-10-13 03:58:44 +00:00
use array argument expansion
This commit is contained in:
parent
43dbc4eb56
commit
6e5a54c5b5
@ -59,11 +59,13 @@ function _auto_notify_message() {
|
|||||||
transient=""
|
transient=""
|
||||||
icon=${AUTO_NOTIFY_ICON_FAILURE:-""}
|
icon=${AUTO_NOTIFY_ICON_FAILURE:-""}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local arguments=("$title" "$body" "--app-name=zsh" "$transient" "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME")
|
||||||
|
|
||||||
if [[ -n "$icon" ]]; then
|
if [[ -n "$icon" ]]; then
|
||||||
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" "--icon=$icon"
|
arguments+=("--icon=$icon")
|
||||||
else
|
|
||||||
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME"
|
|
||||||
fi
|
fi
|
||||||
|
notify-send ${arguments[@]}
|
||||||
|
|
||||||
elif [[ "$platform" == "Darwin" ]]; then
|
elif [[ "$platform" == "Darwin" ]]; then
|
||||||
osascript \
|
osascript \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user