2023-12-03 18:57:36 +00:00
|
|
|
#+title: IRC and Bitlbee Interface
|
|
|
|
#+author: Howard X. Abrams
|
|
|
|
#+date: 2020-12-10
|
|
|
|
#+tags: emacs chat
|
2021-11-24 00:42:00 +00:00
|
|
|
|
|
|
|
A literate programming configuration file for IRC communiction.
|
|
|
|
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp :exports none
|
2022-03-09 18:45:37 +00:00
|
|
|
;;; ha-irc.el --- configuration for IRC communication. -*- lexical-binding: t; -*-
|
|
|
|
;;
|
2023-02-23 17:35:36 +00:00
|
|
|
;; © 2020-2023 Howard X. Abrams
|
2022-06-18 00:25:47 +00:00
|
|
|
;; Licensed under a Creative Commons Attribution 4.0 International License.
|
2022-03-09 18:45:37 +00:00
|
|
|
;; See http://creativecommons.org/licenses/by/4.0/
|
|
|
|
;;
|
|
|
|
;; Author: Howard X. Abrams <http://gitlab.com/howardabrams>
|
|
|
|
;; Maintainer: Howard X. Abrams
|
|
|
|
;; Created: December 10, 2020
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;; *NB:* Do not edit this file. Instead, edit the original literate file at:
|
|
|
|
;; ~/other/hamacs/ha-irc.org
|
|
|
|
;; And tangle the file to recreate this one.
|
|
|
|
;;
|
|
|
|
;;; Code:
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-11-24 00:42:00 +00:00
|
|
|
* Introduction
|
2021-12-14 19:35:54 +00:00
|
|
|
My IRC /needs/ are basic, but I'm not sure which I want to use.
|
2022-04-04 17:27:11 +00:00
|
|
|
** ERC
|
2024-03-04 18:54:45 +00:00
|
|
|
Initial variable configuration for ERC.
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2022-04-04 17:27:11 +00:00
|
|
|
(use-package erc
|
2021-12-14 19:35:54 +00:00
|
|
|
:config
|
2024-03-04 18:54:45 +00:00
|
|
|
(setq erc-nick "howard-abrams"
|
|
|
|
erc-user-full-name "Howard Abrams"
|
|
|
|
erc-server "irc.libera.chat")
|
|
|
|
|
|
|
|
(seq-let (username password) (auth-source-user-and-password "irc.libera.chat")
|
|
|
|
(setq erc-session-username username
|
|
|
|
erc-session-password password
|
|
|
|
erc-password password))
|
|
|
|
|
|
|
|
(setq erc-prompt ">>"
|
|
|
|
erc-prompt-for-nickserv-password nil
|
|
|
|
erc-auto-query 'bury
|
|
|
|
erc-join-buffer 'bury
|
|
|
|
erc-interpret-mirc-color t
|
|
|
|
erc-rename-buffers t
|
|
|
|
erc-hide-list '("JOIN" "PART" "QUIT")
|
|
|
|
erc-track-enable-keybindings nil
|
|
|
|
erc-track-visibility nil ; Only use the selected frame for visibility
|
|
|
|
erc-fill-column 120
|
|
|
|
erc-fill-function 'erc-fill-static
|
|
|
|
erc-fill-static-center 20
|
|
|
|
erc-timestamp-only-if-changed-flag nil
|
|
|
|
;; erc-timestamp-format "%H:%M"
|
|
|
|
erc-autojoin-channels-alist '((".*" "#emacs" "#org-mode"))
|
|
|
|
erc-quit-reason (lambda (s) (or s "Fading out..."))
|
|
|
|
erc-modules
|
|
|
|
'(autoaway autojoin button completion fill irccontrols keep-place
|
|
|
|
list match menu move-to-prompt netsplit networks noncommands
|
|
|
|
readonly ring stamp track hl-nicks)))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-12-14 19:35:54 +00:00
|
|
|
|
2022-04-04 17:27:11 +00:00
|
|
|
I like to make sure the text formats to the size of the window:
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2022-04-04 17:27:11 +00:00
|
|
|
(defun ha-erc-resize-text ()
|
|
|
|
"Resize the ERC text to fill the current window."
|
|
|
|
(interactive)
|
|
|
|
(setq erc-fill-column (1- (window-width))))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2022-04-04 17:27:11 +00:00
|
|
|
|
2024-03-04 18:54:45 +00:00
|
|
|
Interesting plugins:
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package erc-hl-nicks :after erc)
|
|
|
|
(use-package erc-image :after erc)
|
|
|
|
#+end_src
|
|
|
|
|
2021-12-14 19:35:54 +00:00
|
|
|
* ZNC Server
|
|
|
|
I'm using my own ZNC server, and I need to log in with a password stored in my GPG auth storage:
|
|
|
|
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2022-04-04 17:27:11 +00:00
|
|
|
(defun ha-erc-reconnect-password ()
|
2021-12-14 19:35:54 +00:00
|
|
|
"Send the reconnection password string."
|
|
|
|
(interactive)
|
|
|
|
|
|
|
|
(let* ((auth-results (auth-source-search :host "howardabrams.com" :port 7777 :max 1))
|
|
|
|
(auth-first (first auth-results))
|
|
|
|
(username (plist-get auth-first :user))
|
|
|
|
(password (funcall (plist-get auth-first :secret))))
|
2022-04-04 17:27:11 +00:00
|
|
|
(erc-cmd-QUOTE (format "PASS %s:%s" username password))))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-12-14 19:35:54 +00:00
|
|
|
|
|
|
|
* Key Bindings
|
|
|
|
Quick way to start and jump to my IRC world.
|
2024-03-04 18:54:45 +00:00
|
|
|
#+begin_src emacs-lisp :tangle no
|
|
|
|
(defun ha-irc ()
|
2021-12-14 19:35:54 +00:00
|
|
|
(interactive)
|
2024-03-04 18:54:45 +00:00
|
|
|
(erc :server "irc.libera.chat" :port 6667 :full-name erc-user-full-name
|
|
|
|
:nick erc-nick :user erc-session-username :password erc-session-password))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-12-14 19:35:54 +00:00
|
|
|
|
|
|
|
And some global keys to display them:
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2024-03-04 18:54:45 +00:00
|
|
|
(ha-leader "a i" `("irc" . ,(ha-app-perspective "irc" #'ha-erc)))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-12-14 19:35:54 +00:00
|
|
|
|
2023-05-01 18:49:33 +00:00
|
|
|
And a quick shortcuts to call it:
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2024-03-04 18:54:45 +00:00
|
|
|
(use-package major-mode-hydra
|
|
|
|
:after erc
|
|
|
|
:config
|
|
|
|
(major-mode-hydra-define erc-mode nil
|
|
|
|
("Server"
|
|
|
|
(("r" erc-server-reconnect "reconnect")
|
|
|
|
("p" ha-erc-reconnect-password "send password"))
|
|
|
|
"Channel"
|
|
|
|
(("o" erc-track-switch-buffer "next channel")
|
|
|
|
("j" erc-join-channel "join channel")
|
|
|
|
("w" ha-erc-resize-text "resize text")))))
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-11-24 00:42:00 +00:00
|
|
|
* Display Configuration
|
|
|
|
Using the [[https://github.com/seagle0128/doom-modeline][Doom Modeline]] to add notifications:
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp
|
2022-04-04 17:27:11 +00:00
|
|
|
(setq doom-modeline-irc t
|
|
|
|
doom-modeline-irc-stylize 'identity)
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-11-24 00:42:00 +00:00
|
|
|
* Technical Artifacts :noexport:
|
|
|
|
This will =provide= a code name, so that we can =require= this.
|
|
|
|
|
2022-06-18 00:25:47 +00:00
|
|
|
#+begin_src emacs-lisp :exports none
|
2021-11-24 00:42:00 +00:00
|
|
|
(provide 'ha-irc)
|
|
|
|
;;; ha-irc.el ends here
|
2022-06-18 00:25:47 +00:00
|
|
|
#+end_src
|
2021-11-24 00:42:00 +00:00
|
|
|
|
|
|
|
#+DESCRIPTION: A literate programming configuration file for IRC.
|
|
|
|
|
|
|
|
#+PROPERTY: header-args:sh :tangle no
|
2023-07-05 20:20:55 +00:00
|
|
|
#+PROPERTY: header-args:emacs-lisp :tangle yes
|
2021-11-24 00:42:00 +00:00
|
|
|
#+PROPERTY: header-args :results none :eval no-export :comments no mkdirp yes
|
|
|
|
|
2023-12-21 03:54:30 +00:00
|
|
|
#+OPTIONS: num:nil toc:t todo:nil tasks:nil tags:nil date:nil
|
2021-11-24 00:42:00 +00:00
|
|
|
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
|
2023-12-21 03:54:30 +00:00
|
|
|
#+INFOJS_OPT: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
|