From e2d11ddfba4bb92e0fad2bca95306de0806d932e Mon Sep 17 00:00:00 2001 From: Swarsel Date: Mon, 16 Dec 2024 11:37:46 +0100 Subject: [PATCH] feat: elfeed db management --- SwarselSystems.org | 14 ++++++-------- programs/emacs/init.el | 4 +++- programs/emacs/server.el | 10 +++------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 72bb6e1..e5738ea 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -253,18 +253,14 @@ On my server, I use a reduced, self-contained emacs configuration that only serv (defun bjm/elfeed-updater () "Wrapper to load the elfeed db from disk before opening" (interactive) - (elfeed-db-save) - (quit-window) - (elfeed-db-load) - (elfeed) - (elfeed-search-update--force) - (elfeed-update)) + (elfeed-db-load)) -(run-with-timer 0 (* 30 60) 'bjm/elfeed-updater) +(run-with-timer 0 (* 1 60) 'bjm/elfeed-updater) (setq httpd-port 9812) (setq httpd-host "0.0.0.0") (setq httpd-root "/root/.emacs.d/elpa/elfeed-web-20240729.1741/") +(setq elfeed-db-directory "/var/lib/syncthing/.elfeed/db/") (httpd-start) (elfeed-web-start) @@ -10743,7 +10739,7 @@ I also define some keybinds to some combinations directly. Those are used mostly "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar") "mp" '(popper-toggle :which-key "popper") "md" '(dirvish :which-key "dirvish") - "mr" '(elfeed :which-key "elfeed") + "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed") "o" '(:ignore o :which-key "org") "op" '((lambda () (interactive) (org-present)) :which-key "org-present") "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda") @@ -12424,6 +12420,8 @@ This mode is not automatically activated anywhere because I only rarely need it. (elfeed-db-save) (quit-window)) + (setq elfeed-db-directory "~/.elfeed/db/") + (global-set-key (kbd "C-c w") 'bjm/elfeed-load-db-and-open) diff --git a/programs/emacs/init.el b/programs/emacs/init.el index 5103123..52d6540 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -330,7 +330,7 @@ create a new one." "mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar") "mp" '(popper-toggle :which-key "popper") "md" '(dirvish :which-key "dirvish") - "mr" '(elfeed :which-key "elfeed") + "mr" '(bjm/elfeed-load-db-and-open :which-key "elfeed") "o" '(:ignore o :which-key "org") "op" '((lambda () (interactive) (org-present)) :which-key "org-present") "oa" '((lambda () (interactive) (org-agenda)) :which-key "org-agenda") @@ -1304,6 +1304,8 @@ create a new one." (elfeed-db-save) (quit-window)) +(setq elfeed-db-directory "~/.elfeed/db/") + (global-set-key (kbd "C-c w") 'bjm/elfeed-load-db-and-open) diff --git a/programs/emacs/server.el b/programs/emacs/server.el index 5629452..bc21d49 100644 --- a/programs/emacs/server.el +++ b/programs/emacs/server.el @@ -67,18 +67,14 @@ (defun bjm/elfeed-updater () "Wrapper to load the elfeed db from disk before opening" (interactive) - (elfeed-db-save) - (quit-window) - (elfeed-db-load) - (elfeed) - (elfeed-search-update--force) - (elfeed-update)) + (elfeed-db-load)) -(run-with-timer 0 (* 30 60) 'bjm/elfeed-updater) +(run-with-timer 0 (* 1 60) 'bjm/elfeed-updater) (setq httpd-port 9812) (setq httpd-host "0.0.0.0") (setq httpd-root "/root/.emacs.d/elpa/elfeed-web-20240729.1741/") +(setq elfeed-db-directory "/var/lib/syncthing/.elfeed/db/") (httpd-start) (elfeed-web-start)