From 50ec18ee92b9a90da96876c83b4a563c447ce7dc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:03:49 +0400 Subject: [PATCH] config/emacs: irc attempt 2 --- config/emacs/emacs.org | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index bdc9ef29..972a3241 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1102,6 +1102,29 @@ Will configure later, (use elfeed protocol ok ty) (setq elfeed-protocol-enabled-protocols '(fever)) (elfeed-protocol-enable)) #+end_src +** IRC (erc) +#+begin_src emacs-lisp + (require 'erc) + + (setq erc-server "znc.sako.box") + (setq erc-port "7000") + (setq erc-prompt "(^w^)->") + + (defun sakomacs/erc-znc-detach-channel () + (when (erc-server-process-alive) + (let ((tgt (erc-default-target))) + (erc-server-send (format "DETACH %s" tgt) + nil tgt)))) + + (add-hook 'erc-kill-channel-hook (sakomacs/erc-znc-detach-channel)) + + (defun sakomacs/begin-irc () + (interactive) + (erc-tls :server "znc.sako.box" :port "7000" :nick "sako" :password (concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC")))) + + (advice-add 'irc :override + (sakomacs/begin-irc)) +#+end_src ** Matrix Ill set this up later as well #+begin_src emacs-lisp