Last active
December 11, 2015 19:28
-
-
Save peccu/4648662 to your computer and use it in GitHub Desktop.
terminal-notifierをEmacsから呼び出す.
おまけでsayコマンドとかsaykanaコマンドも呼ぶ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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