From 51d2463a8d900c5858caf1c6acfe86db6e772f8d Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 19 Nov 2024 22:12:17 +0100 Subject: [PATCH] Move RSS configuration to module --- +rss.el | 30 ++++++++++++++++++++++++++++++ config.el | 29 ++--------------------------- 2 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 +rss.el diff --git a/+rss.el b/+rss.el new file mode 100644 index 0000000..19e1f7f --- /dev/null +++ b/+rss.el @@ -0,0 +1,30 @@ +;;; +rss.el -*- lexical-binding: t; -*- +;; Elfeed configuration +;; +;; Synchronize elfeed with Miniflux +(setq elfeed-use-curl t + elfeed-protocol-feeds (list + (list "fever+https://coolneng@rss.coolneng.duckdns.org" + :api-url "https://rss.coolneng.duckdns.org/fever/" + :password (auth-source-pass-get 'secret "api/miniflux"))) + elfeed-sort-order 'ascending + elfeed-search-filter "@all +unread" + elfeed-goodies/tag-column-width 0) +(elfeed-protocol-enable) +;; Update RSS feeds on startup +(add-hook! 'elfeed-search-mode-hook 'elfeed-update) +;; Use different font and show article in fullscreen +(setq elfeed-show-entry-switch #'switch-to-buffer) +(defadvice! +rss-elfeed-wrap-h-nicer () + "Enhances an elfeed entry's readability by wrapping it to a width of +`fill-column' and centering it with `visual-fill-column-mode'." + :override #'+rss-elfeed-wrap-h + (setq-local truncate-lines nil + shr-width 160 + visual-fill-column-center-text t + default-text-properties '(line-height 1.1)) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) + (visual-fill-column-mode) + (setq-local shr-current-font '(:family "Lato" :height 1.1)) + (set-buffer-modified-p nil))) diff --git a/config.el b/config.el index f715710..559a873 100644 --- a/config.el +++ b/config.el @@ -88,33 +88,8 @@ (setq display-line-numbers-type 'relative) ;; Use pass as auth-source (add-to-list 'auth-sources 'password-store) -;; Set up elfeed -(after! elfeed - (setq elfeed-use-curl t) - (setq elfeed-protocol-feeds (list - (list "fever+https://coolneng@rss.coolneng.duckdns.org" - :api-url "https://rss.coolneng.duckdns.org/fever/" - :password (auth-source-pass-get 'secret "api/miniflux")))) - (setq elfeed-sort-order 'ascending - elfeed-search-filter "@all +unread" - elfeed-goodies/tag-column-width 0) - (elfeed-protocol-enable) - (add-hook! 'elfeed-search-mode-hook 'elfeed-update) - ;; Use different font and show article in fullscreen - (setq elfeed-show-entry-switch #'switch-to-buffer) - (defadvice! +rss-elfeed-wrap-h-nicer () - "Enhances an elfeed entry's readability by wrapping it to a width of -`fill-column' and centering it with `visual-fill-column-mode'." - :override #'+rss-elfeed-wrap-h - (setq-local truncate-lines nil - shr-width 160 - visual-fill-column-center-text t - default-text-properties '(line-height 1.1)) - (let ((inhibit-read-only t) - (inhibit-modification-hooks t)) - (visual-fill-column-mode) - (setq-local shr-current-font '(:family "Lato" :height 1.1)) - (set-buffer-modified-p nil)))) +;; Set up RSS reader +(after! elfeed (load! "+rss")) ;; Set up the mail stack (after! mu4e (load! "+mail")) ;; HACK Enable AOT native compilation