# Check if it makes sense to load the notify module. # # Checks for requirements, that it is an xsession, etc. # # Authors: # Alex Reece # function should_load_notify_module { case "$OSTYPE" in (darwin*) # For now, always enable on mac osx. # TODO(awreece) Disable if ssh with no windows? return 0 ;; (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 }