目录

mac环境org-pomodoro番茄钟添加提示信息以及声音

给org-pomodoro添加弹出框以及声音提示

安装terminal-notifier

brew install terminal-notifier

在init.el中配置如下

定义通知函数

(defun notify-osx (title message)
      (call-process "terminal-notifier"
	      nil 0 nil
	      "-group" "Emacs"
	      "-title" title
	      "-sound" "deflaut"
	      "-message" message
	      "-activate" "org.gnu.Emacs"))

调用通知函数

(add-hook 'org-pomodoro-finished-hook
      (lambda ()
	      (notify-osx "Pomodoro completed!" "Time for a break.")))
(add-hook 'org-pomodoro-break-finished-hook
      (lambda ()
	(notify-osx "Pomodoro Short Break Finished" "Ready for Another?")))
(add-hook 'org-pomodoro-long-break-finished-hook
      (lambda ()
	      (notify-osx "Pomodoro Long Break Finished" "Ready for Another?")))
(add-hook 'org-pomodoro-killed-hook
      (lambda ()
	      (notify-osx "Pomodoro Killed" "One does not simply kill a pomodoro!")))