From eacd7d562f2ebda1cf25878ab3520010fd8077e9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:29:50 +0400 Subject: [PATCH] emacs/init.el: add elcord --- config/emacs/init.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/config/emacs/init.el b/config/emacs/init.el index 605dd11a..7e0eb58a 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -437,4 +437,31 @@ (use-package org-pomodoro :ensure t) +;; --- Social --- + +;; elcord +(use-package elcord + :init + (setq elcord-display-buffer-details nil) + (setq elcord-use-major-mode-as-main-icon t) + (setq elcord-quiet t) + (setq elcord-display-elapsed nil) + :config + (defun elcord--disable-elcord-if-no-frames (f) + (ignore f) + (when (let ((frames (delete f (visible-frame-list)))) + (or (null frames) + (elcord-mode -1))))) + + (defun elcord--enable-on-frame-created (f) + (elcord-mode +1)) + + (add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created) + + (defun sakomacs/elcord-mode-hook () + (if elcord-mode + (add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames) + (remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames))) + (elcord-mode) + (add-hook 'elcord-mode-hook 'sakomacs/elcord-mode-hook)) ;;; init.el ends here