Skip to content

Instantly share code, notes, and snippets.

@peccu
Last active December 11, 2015 19:28
Show Gist options
  • Save peccu/4648662 to your computer and use it in GitHub Desktop.
Save peccu/4648662 to your computer and use it in GitHub Desktop.
terminal-notifierをEmacsから呼び出す. おまけでsayコマンドとかsaykanaコマンドも呼ぶ
;; call terminal-notifier
;; (osx-notify :title "Cat" :message "mew")
;; with say command
;; (osx-notify :title "Cat" :message "mew" :say "mee")
;; if you have saykana command you can use it
;; (osx-notify :title "Cat" :message "mew" :saykana "に'ゃー")
;; terminal-notifier
;; sudo port install terminal-notifier
;; saykana
;; http://www.a-aquest.com/aquestalk/saykana/
(require 'deferred)
(eval-when-compile
(require 'cl))
(defun* osx-notify (&key (group "Emacs")
(title "Emacs terminal notifier") subtitle
(message "test") say saykana)
(deferred:$
(deferred:process "terminal-notifier"
"-group" group
"-title" title
(if subtitle "-subtitle" "")
(if subtitle subtitle "")
"-message" message)
(deferred:nextc it
(when say
(deferred:process "say" say)))
(deferred:nextc it
(when saykana
(deferred:process "saykana" saykana)))))
(provide 'osx-notify)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment