diff --git a/README.rst b/README.rst index 70ea746..a69648d 100644 --- a/README.rst +++ b/README.rst @@ -162,6 +162,17 @@ then all the values in ``AUTO_NOTIFY_IGNORE`` are not used. export AUTO_NOTIFY_WHITELIST=("apt-get" "docker") +**Adding an icon - Linux** + +If you wish to have an icon displayed on command success and/or failure, you can do so by defining the environmental variables ``AUTO_NOTIFY_ICON_SUCCESS`` and ``AUTO_NOTIFY_ICON_FAILURE`` respectively. + +:: + + export AUTO_NOTIFY_ICON_SUCCESS=/path/to/success/icon.png + export AUTO_NOTIFY_ICON_FAILURE=/path/to/failure/icon.png + + + Temporarily Disabling Notifications ----------------------------------- diff --git a/tests/test_auto_notify_send.zunit b/tests/test_auto_notify_send.zunit index 4748b2b..49e477f 100644 --- a/tests/test_auto_notify_send.zunit +++ b/tests/test_auto_notify_send.zunit @@ -92,6 +92,21 @@ 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' { + AUTO_COMMAND="f bar -r" + AUTO_COMMAND_FULL="foo bar -r" + AUTO_COMMAND_START=11080 + AUTO_NOTIFY_EXPIRE_TIME=15000 + AUTO_NOTIFY_ICON_SUCCESS=/path/to/success/icon.png + run _auto_notify_send + + assert $state equals 0 + 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 --icon=/path/to/success/icon.png" +} + @test 'auto-notify-send sends notification on macOS' { AUTO_COMMAND="f bar -r" AUTO_COMMAND_FULL="foo bar -r"