1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/modules/notify/functions/should_auto_notify

36 lines
723 B

# Check if it makes sense to load the notify module.
#
# Checks for requirements, that it is an xsession, etc.
#
# Authors:
# Alex Reece <awreece@gmail.com>
#
if ! zstyle -t ':prezto:module:notify' auto-notify; then
return 1
fi
case "$OSTYPE" in
(darwin*)
# TODO(awreece) Disable if ssh with no windows?
is-callable terminal-notifier || is-callable growlnotify
;;
(linux-gnu*)
# Disable if don't have X.
if [[ -z $XAUTHORITY ]]; then
return 1
fi
# We need both of these functions to operate.
if (( ! $+commands[notify-send] || ! $+commands[xprop] )); then
return 1
fi
return 0
;;
(*)
# If we don't know, then just disable.
return 1
;;
esac