diff --git a/.circleci/config.yml b/.circleci/config.yml index 236e963..45f4411 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ test: &test - checkout - run: name: Install Dependencies - command: apt-get update && apt-get install -y curl git ncurses-bin + command: apt-get update && apt-get install -y curl git ncurses-bin libnotify-bin - run: name: Download requirements command: | @@ -25,7 +25,7 @@ test: &test jobs: lint: docker: - - image: "python:3.7-stretch" + - image: "python:3.11" steps: - checkout - run: diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index 2a3f3e5..1dc849f 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -1,4 +1,4 @@ -export AUTO_NOTIFY_VERSION="0.8.0" +export AUTO_NOTIFY_VERSION="0.8.1" # Time it takes for a notification to expire [[ -z "$AUTO_NOTIFY_EXPIRE_TIME" ]] && @@ -51,10 +51,12 @@ function _auto_notify_message() { if [[ "$platform" == "Linux" ]]; then local urgency="normal" + local transient="--hint=int:transient:1" if [[ "$exit_code" != "0" ]]; then urgency="critical" + transient="" fi - notify-send "$title" "$body" --app-name=zsh "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" + notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" 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 5704f6b..4748b2b 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 --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 on macOS' {