[project @ sridhar.ratna@gmail.com-20070917031430-uqleoxeqf05ucn4f]
[srid.dotfiles.git] / emacs / rcirc-init.el
blobce00c16d7c72ed544682fa6b69bae9de33f54361
1 ;; Author: Sridhar Ratna
2 ;; URL: http://freeshell.in/~srid/dotfiles/emacs/dot-emacs
4 (require 'rcirc)
5 ;(load "rcirc-nick-colors.el")
8 (defun flash-emacs (prefix)
9 (setq frame-title-format
10 (format "%s%%b - Emacs" prefix))
11 (setq icon-title-format
12 "%b - ICEmacs"))
14 (defun wmii-notify (msg)
15 ;; this requires the wmii-ruby plugin `wmii-notifier.rb`
16 ;; http://nearfar.org/code/dotfiles/dot-wmii-3/plugins/wmii-notifier.rb
17 (start-process "bash" nil "bash" "-c"
18 (format "echo -n \"%s\" > ~/.wmii-notifier" msg)))
20 (add-hook 'rcirc-print-hooks 'my-rcirc-print-hook)
21 (setq alert "/usr/share/sounds/gaim/alert.wav")
22 (defun my-rcirc-print-hook (process sender response target text)
23 (when (and (string-match (rcirc-nick process) text)
24 (not (string= (rcirc-nick process) sender))
25 (not (string= (rcirc-server-name process) sender)))
26 ;; different ways to notify the user
27 ;; beep, libnotify, emacs-title,.. and wmii!
28 (start-process "beep" nil "aplay" (expand-file-name alert))
29 (start-process "notify" nil "~/bin/notify.py"
30 (format "'channel: %s'" target)
31 (format "'%s messaged ya'" sender))
32 ; (flash-emacs (format "** %s ** " sender))
33 (wmii-notify (format "%s: %s messaged ya" target sender)))
34 (when (string= (rcirc-nick process) sender)
35 ; (flash-emacs "")
36 (wmii-notify ":-)")))
38 (load "~/.freenode.el")
39 (setq rcirc-authinfo
40 (list
41 (list "freenode" 'nickserv "srid" passwd)
42 (list "oftc" 'nickserv "srid" passwd)
43 (list "bitlbee" 'bitlbee "srid" passwd)))
45 (defun im ()
46 (interactive)
47 (rcirc-connect "testing.bitlbee.org" 6667
48 "srid" "srid" "Sridhar Ratnakumar"))
50 (defun irc-oftc ()
51 (interactive)
52 (rcirc-connect "irc.oftc.net" 6667
53 "srid" "srid" "Sridhar Ratnakumar"))