From abf24e71c784111a65f56dc6613c020495c49927 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 2 Apr 2022 13:53:11 -0500 Subject: Enable +elfeed-update-command to run only sometimes --- init.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 8e92143..3c1d975 100644 --- a/init.el +++ b/init.el @@ -1394,8 +1394,17 @@ See also `crux-reopen-as-root-mode'." (:hook #'reading-mode) (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour +elfeed--update-first-time 60)) - (+elfeed-update-async-mode -1) ; It really messes with stuff for work - ) + (+elfeed-update-async-mode +1) + (add-hook '+elfeed-update-proceed-hook (defun non-work-hours? () + "Return nil if during work hours, t otherwise." + (let* ((now (current-time)) + (now* (decode-time now)) + (work-start* (append '(0 0 8) (cdddr now*))) ; 8:00 AM + (work-end* (append '(0 0 18) (cdddr now*))) ; 6:00 PM + (work-start (encode-time work-start*)) + (work-end (encode-time work-end*))) + (or (time-less-p now work-start) + (time-less-p work-end now)))))) (setup (:straight elfeed-org) (:also-load +org-capture) -- cgit 1.4.1-21-gabe81