chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aeba0b8
)
bin/wakey.zsh: Don't do anything if there's no X display, or `notify-send'.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 20 Apr 2020 12:14:23 +0000
(13:14 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 20 Apr 2020 12:24:52 +0000
(13:24 +0100)
bin/wakey.zsh
patch
|
blob
|
blame
|
history
diff --git
a/bin/wakey.zsh
b/bin/wakey.zsh
index 41ccafd9561367475617840ca2c15575e6d220bf..94638caa84ebad8518ae2e252fb17671bc1fb99d 100644
(file)
--- 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