Posted By

noah on 02/15/09


Tagged

mac growl growlnotify osx notification emacs irc chat darwin erc


Versions (?)

Growl support for Aquamacs Emacs


 / Published in: Emacs Lisp
 

URL: http://www.emacswiki.org/emacs/CustomizeAquamacs#toc1

This is what I had to do in order to get reliable Growl support in Aquamacs 1.7

Requires Growlnotify (included with Growl, in the extras folder).

  1. ;; Growl support
  2. ;;; Requires growlnotify, source for which is included in the Growl disk image
  3. ;;; Note that the growlnotify --image option is not reliable on OSX 10.5
  4. ;;; see http://forums.cocoaforge.com/viewtopic.php?f=6&t=17526&p=114069
  5.  
  6. ;;; Wrapper for growlnotify
  7. (defun growl-chat (title message &optional sticky)
  8. (interactive "sTitle: \nsGrowl: ")
  9. (shell-command
  10. (format "/usr/local/bin/growlnotify %s -m '%s' --appIcon 'Aquamacs Emacs' %s" title message (if sticky "--sticky" ""))))
  11.  
  12. ;;; Sticky notifications
  13. (defun growl-chat-sticky (title message)
  14. (interactive "sTitle: \nsGrowl: ")
  15. (growl-chat title message t))
  16.  
  17. ;;; Growl nicknames and highlight words when they are mentioned
  18. ;;;; Nickname notifications are sticky
  19. (add-hook 'erc-text-matched-hook
  20. (lambda (match-type nickuserhost message)
  21. (when (and
  22. (boundp 'nick)
  23. (not (string= nick "ChanServ"))
  24. (not (string= nick "services.")))
  25. (cond
  26. ((eq match-type 'current-nick)
  27. (growl-chat-sticky (format "%s said %s" nick (erc-current-nick)) message))
  28. ((eq match-type 'keyword)
  29. (growl-chat (format "%s mentioned a Keyword" nick) message))))))

Report this snippet  

You need to login to post a comment.