From 9bfb5d0d983f083558ecba51368ac4980f6008c7 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sun, 4 Jul 2021 08:13:43 +0800
Subject: [PATCH] org-clock.el: Make org-notify support macOS notification

* lisp/org-clock.el (org-show-notification): Add support for macOS
notification.
---
 lisp/org-clock.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index cd930e875..314233156 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -859,7 +859,7 @@ use libnotify if available, or fall back on a message."
 	    org-show-notification-timeout
 	    nil
 	    (lambda () (w32-notification-close id)))))
-	((fboundp 'notifications-notify)
+	((and (eq system-type 'gnu/linux) (fboundp 'notifications-notify))
 	 (notifications-notify
 	  :title "Org mode message"
 	  :body notification
@@ -870,6 +870,8 @@ use libnotify if available, or fall back on a message."
 	((executable-find "notify-send")
 	 (start-process "emacs-timer-notification" nil
 			"notify-send" notification))
+        ((and (eq system-type 'darwin) (fboundp 'osx-lib-notify2))
+         (osx-lib-notify2 "Org mode message" notification))
 	;; Maybe the handler will send a message, so only use message as
 	;; a fall back option
 	(t (message "%s" notification))))
-- 
2.30.1 (Apple Git-130)

