From 791efc1ca2ca4b1ed8695f7212111e5def2986fe Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Wed, 13 Aug 2025 12:25:26 +0200 Subject: [PATCH] Add option to enable notifications on remote ssh machine --- README.rst | 2 ++ auto-notify.plugin.zsh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index b955a5d..2312678 100644 --- a/README.rst +++ b/README.rst @@ -129,6 +129,8 @@ NOTE: This configuration option currently only works for Linux. :: + # Enable notifications on remote machine but do not forward + export AUTO_NOTIFY_ENABLE_SSH=2 # Enable notification forwarding to SSH client export AUTO_NOTIFY_ENABLE_SSH=1 # Disable notification forwarding to SSH client diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index ce3c90d..cef0517 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -90,7 +90,7 @@ function _auto_notify_message() { fi # Check if the script is running over SSH - if [[ -n "${SSH_CLIENT}" || -n "${SSH_CONNECTION}" ]]; then + if [[ -n "${SSH_CLIENT}" || -n "${SSH_CONNECTION}" ]] && [[ "${AUTO_NOTIFY_ENABLE_SSH-1}" == "1" ]]; then # Extract the client IP address from environment local client_ip="${SSH_CLIENT%% *}" [[ -z "$client_ip" ]] && client_ip="${SSH_CONNECTION%% *}"