From: Mark Wooding Date: Mon, 20 Apr 2020 12:14:23 +0000 (+0100) Subject: bin/wakey.zsh: Don't do anything if there's no X display, or `notify-send'. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/0b69235c37663429003691a815b78c645d42f783 bin/wakey.zsh: Don't do anything if there's no X display, or `notify-send'. --- diff --git a/bin/wakey.zsh b/bin/wakey.zsh index 41ccafd..94638ca 100644 --- a/bin/wakey.zsh +++ b/bin/wakey.zsh @@ -40,5 +40,12 @@ __wakey_precmd () { esac } -preexec_functions+=(__wakey_preexec) -precmd_functions+=(__wakey_precmd) +case ${DISPLAY-nil} in + nil) ;; + *) + if whence notify-send >/dev/null 2>&1; then + preexec_functions+=(__wakey_preexec) + precmd_functions+=(__wakey_precmd) + fi + ;; +esac