Merge pull request #61 from MichaelAquilina/fix/bad-icon-path
fix: correctly omit --icon from notify-send when not set
This commit is contained in:
commit
055a5fa8ae
3 changed files with 4 additions and 14 deletions
|
@ -59,12 +59,12 @@ function _auto_notify_message() {
|
||||||
transient=""
|
transient=""
|
||||||
icon=${AUTO_NOTIFY_ICON_FAILURE:-""}
|
icon=${AUTO_NOTIFY_ICON_FAILURE:-""}
|
||||||
fi
|
fi
|
||||||
local icon_arg=""
|
|
||||||
if [[ -n "$icon" ]]; then
|
if [[ -n "$icon" ]]; then
|
||||||
icon_arg="--icon=$icon"
|
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"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" "$icon_arg"
|
|
||||||
elif [[ "$platform" == "Darwin" ]]; then
|
elif [[ "$platform" == "Darwin" ]]; then
|
||||||
osascript \
|
osascript \
|
||||||
-e 'on run argv' \
|
-e 'on run argv' \
|
||||||
|
|
|
@ -10,16 +10,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'version exported' {
|
|
||||||
git_version="$(git tag --list | sort -V | tail -1)"
|
|
||||||
git tag --list
|
|
||||||
|
|
||||||
load "../auto-notify.plugin.zsh"
|
|
||||||
|
|
||||||
assert "$AUTO_NOTIFY_VERSION" is_not_empty
|
|
||||||
assert "$AUTO_NOTIFY_VERSION" same_as "$git_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
@test 'print warning if notify-send is not installed' {
|
@test 'print warning if notify-send is not installed' {
|
||||||
function type {
|
function type {
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue