Skip to content

Instantly share code, notes, and snippets.

@andresilva
Created May 6, 2014 23:11
Show Gist options
  • Save andresilva/068f3679b5f0e1b368b8 to your computer and use it in GitHub Desktop.
Save andresilva/068f3679b5f0e1b368b8 to your computer and use it in GitHub Desktop.
(defun erc-notify-on-private-msg-darwin (proc parsed)
(let ((nick (car (erc-parse-user (erc-response.sender parsed))))
(target (car (erc-response.command-args parsed)))
(msg (erc-response.contents parsed)))
(when (and (erc-current-nick-p target)
(not (erc-is-message-ctcp-and-not-action-p msg))
(erc-notify-allowed-p nick))
(shell-command-to-string
(format "terminal-notifier -sender org.gnu.Emacs -message '%s says: %s'" nick msg))
nil)))
(when (eq system-type 'darwin)
(add-hook 'erc-server-PRIVMSG-functions 'erc-notify-on-private-msg-darwin))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment