diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index a2dc4c3..c6dfc82 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -59,12 +59,12 @@ function _auto_notify_message() { transient="" icon=${AUTO_NOTIFY_ICON_FAILURE:-""} fi - local icon_arg="" 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 - notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" "$icon_arg" elif [[ "$platform" == "Darwin" ]]; then osascript \ -e 'on run argv' \ diff --git a/tests/test_auto_notify_send.zunit b/tests/test_auto_notify_send.zunit index 081cf13..49e477f 100644 --- a/tests/test_auto_notify_send.zunit +++ b/tests/test_auto_notify_send.zunit @@ -89,7 +89,7 @@ assert "$lines[1]" same_as 'Notification Title: "f bar -r" Completed' assert "$lines[2]" same_as "Notification Body: Total time: 20 seconds" assert "$lines[3]" same_as "Exit code: 0" - assert "$lines[4]" same_as "--app-name=zsh --hint=int:transient:1 --urgency=normal --expire-time=15000 " + assert "$lines[4]" same_as "--app-name=zsh --hint=int:transient:1 --urgency=normal --expire-time=15000" } @test 'auto-notify-send sends notification and icon on Linux on success' { diff --git a/tests/test_plugin.zunit b/tests/test_plugin.zunit index bbcaa4c..e1c1543 100644 --- a/tests/test_plugin.zunit +++ b/tests/test_plugin.zunit @@ -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' { function type { return 1