Add LONG_RUNNING_COMMAND_CUSTOM for a custom notification other than notify send.   Can use this for sending notifications to pushover (say).
Also check that $DISPLAY is set before using notify send.
Check $DISPLAY before looking for active window
Check for nowindowid in current window