Skip to content

Alerts (notifications) on top of emacs rcirc. Five different kinds of alerts are managed. They can be configured and disabled in a per buffer (channel) basis

Notifications You must be signed in to change notification settings

csantosb/rcirc-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rcirc-alert.el

Configurable alert messages on top of RCIRC

Install

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)

Usage

  1. Autoload RCIRC with
(autoload 'rcirc "rcirc.el" "Connect to IRC." t)
  1. 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)
     )
  )
  1. 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")
     )
  )
  1. 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)
                )
              )

             )
            )
          )

Helping out

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.

License

Same as Emacs

About

Alerts (notifications) on top of emacs rcirc. Five different kinds of alerts are managed. They can be configured and disabled in a per buffer (channel) basis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published