Adding ednc (notifications) to Doom Emacs.

This commit is contained in:
Derek Taylor
2023-01-01 09:46:37 -06:00
parent a2897010b8
commit e6c9be411b
3 changed files with 43 additions and 0 deletions

View File

@@ -184,6 +184,24 @@ List of keybindings (SPC h b b)")
(map! :leader
:desc "Load new theme" "h t" #'counsel-load-theme)
(ednc-mode 1)
(defun show-notification-in-buffer (old new)
(let ((name (format "Notification %d" (ednc-notification-id (or old new)))))
(with-current-buffer (get-buffer-create name)
(if new (let ((inhibit-read-only t))
(if old (erase-buffer) (ednc-view-mode))
(insert (ednc-format-notification new t))
(pop-to-buffer (current-buffer)))
(kill-buffer)))))
(add-hook 'ednc-notification-presentation-functions
#'show-notification-in-buffer)
(evil-define-key 'normal ednc-view-mode-map "d" 'ednc-dismiss-notification)
(evil-define-key 'normal ednc-view-mode-map (kbd "RET") 'ednc-invoke-action)
(evil-define-key 'normal ednc-view-mode-map (kbd "TAB") 'ednc-toggle-expanded-view)
(use-package! elfeed-goodies)
(elfeed-goodies/setup)
(setq elfeed-goodies/entry-pane-size 0.5)