Configurable alert messages on top of RCIRC
Just update the path in your init.el or .emacs
(add-to-list 'load-path "path/to/rcirc-alert.el")
and then
(require 'rcirc-alert)
- Autoload RCIRC with
(autoload 'rcirc "rcirc.el" "Connect to IRC." t)
- Before starting up RCIRC declare a few servers an require rcirc-alert
(eval-after-load "rcirc"
'(progn
(setq-default rcirc-server-alist '(("irc.freenode.net"
:channels ("#archlinux" "#emacs" "#org-mode")
:nick "nick"
:port port.nb
:user-name "username"
:full-name "fullname")
("server-ip"
:password "pasword"
:nick "nick"
:port port
:user-name "user-name"
:full-name "full-name"
:channels ("&jabber"))))
(setq-default rcirc-authinfo '(("freenode" nickserv "nick" "password")
("server-ip" bitlbee "nick" "password")))
(require 'rcirc-alert)
)
)
- Declare default values per buffer (channel)
(eval-after-load 'rcirc-alert
'(progn
;; Enable / disable notifications
(setq-default rcirc-enable-alert-nick t)
(setq-default rcirc-enable-alert-keywords t)
(setq-default rcirc-enable-alert-always nil)
;; Alert library triggers when one of these words appear
(setq-default rcirc-alert-keywords nil)
;; Alert library triggers the nick status change on these nicks
(setq-default rcirc-alert-nicks nil)
;; Dim some nicks
(setq-default rcirc-dim-nicks nil)
;; Bright the list of contacts for any channel
(setq-default rcirc-bright-nicks nil)
;; Omit mode
(setq-default rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
(setq-default rcirc-omit-threshold' 100)
;; Notification timeout
(setq-default rcirc-alert-timeout 5)
;; Alert library uses this script
(setq-default my-rcirc-notification-script "path/to/rcirc-alert.sh")
)
)
- Declare custom values per buffer (channel)
(add-hook 'rcirc-mode-hook
(lambda ()
(rcirc-omit-mode)
;; Per buffer (channel) configuration
(cond
;; #TWITTER Channel
((string= (substring (buffer-name) 0 (string-match-p (regexp-quote "@") (buffer-name))) "#twitter_nick")
(progn
;; Enable / disable notifications
(setq-local rcirc-enable-alert-nick t)
(setq-local rcirc-enable-alert-keywords t)
(setq-local rcirc-enable-alert-always t)
;; Alert library triggers when one of these words appear
(setq-local rcirc-alert-keywords '("" "" ""))
;; Alert library triggers the nick status change on these nicks
(setq-local rcirc-alert-nicks '("" "" "" "" "" "" ""))
;; Dim some nicks
(setq-local rcirc-dim-nicks nil)
;; Bright the list of contacts for any channel
(setq-local rcirc-bright-nicks rcirc-alert-nicks)
;; Omit mode
(setq-local rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
(setq-local rcirc-omit-threshold' 100)
)
)
;; &JABBER Channel
((string= rcirc-target "&jabber")
(progn
;; Enable / disable notifications
(setq-local rcirc-enable-alert-nick t)
(setq-local rcirc-enable-alert-keywords t)
(setq-local rcirc-enable-alert-always nil)
;; Alert library triggers when one of these words appear
(setq-local rcirc-alert-keywords '(""))
;; Alert library triggers the nick status change on these nicks
(setq-local rcirc-alert-nicks '("" "" "" ""))
;; Dim some nicks
(setq-local rcirc-dim-nicks nil)
;; Bright the list of contacts for any channel
(setq-local rcirc-bright-nicks rcirc-alert-nicks)
;; Omit mode
(setq-local rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
(setq-local rcirc-omit-threshold' 100)
)
)
;; #EMACS Channel
((string= rcirc-target "#emacs")
(progn
;; Enable / disable notifications
(setq-local rcirc-enable-alert-nick t)
(setq-local rcirc-enable-alert-keywords t)
(setq-local rcirc-enable-alert-always nil)
;; Alert library triggers when one of these words appear
(setq-local rcirc-alert-keywords '(""))
;; Alert library triggers the nick status change on these nicks
(setq-local rcirc-alert-nicks '("" "" ""))
;; Dim some nicks
(setq-local rcirc-dim-nicks nil)
;; Bright the list of contacts for any channel
(setq-local rcirc-bright-nicks rcirc-alert-nicks)
;; Omit mode
(setq-local rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY"))
(setq-local rcirc-omit-threshold' 100)
)
)
)
)
)
If you want to help out, great! This is my first emacs plugin, so help is much appreciated. Open an issue or check out the existing issues list for some ideas on what might need updating/fixing.
Same as Emacs