Skip to content

Instantly share code, notes, and snippets.

@marktran
Created October 14, 2009 23:58
Show Gist options
  • Save marktran/210513 to your computer and use it in GitHub Desktop.
Save marktran/210513 to your computer and use it in GitHub Desktop.
(defun growl-chat (title message)
(interactive "sTitle: \nsMessage: ")
(shell-command-to-string
(format "/opt/local/bin/growlnotify --appIcon 'Emacs' -t $'%s' -m $'%s'"
(replace-regexp-in-string "'" "\\\\'" title)
(replace-regexp-in-string "'" "\\\\'" message))))
(when (eq system-type 'darwin)
(add-hook 'erc-text-matched-hook
(lambda (match-type nickuserhost message)
(when (and
(boundp 'nick)
(not (string= nick "ChanServ"))
(not (string= nick "services."))
(not (string= nick (erc-current-nick))))
(cond
((eq match-type 'current-nick)
(growl-chat
(format "ERC")
(format "<%s> %s" nick message)))
((eq match-type 'keyword)
(growl-chat
(format "ERC")
(format "<%s> %s" nick message))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment