commit 9aa8aa433019a45ae213f40e553ac9904ec00360 parent 67fe6802966ec6b47912fad5111d55f204cb4005 Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 8 Jul 2022 17:04:38 +0200 tools/emacs: more elfeed customization Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tools/emacs/config/config-elfeed.el | | | 50 | +++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/tools/emacs/config/config-elfeed.el b/tools/emacs/config/config-elfeed.el @@ -20,9 +20,57 @@ :link link :description title) ))) - (add-hook 'org-store-link-functions 'vde/org-elfeed-entry-store-link) + + (defun elfeed-link-title (entry) + "Copy the entry title and URL as org link to the clipboard." + (interactive) + (let* ((link (elfeed-entry-link entry)) + (title (elfeed-entry-title entry)) + (titlelink (org-make-link-string link title)))) + (when titlelink + (kill-new titlelink) + (x-set-selection 'PRIMARY titlelink) + (message "Yanked: %s" titlelink))) + (defun elfeed-show-link-title () + "Copy the current entry title and URL as org link to the clipboard." + (interactive) + (elfeed-link-title elfeed-show-entry)) + + (defun elfeed-show-quick-url-note () + "Fastest way to capture entry link to org agenda from elfeed show mode" + (interactive) + (elfeed-link-title elfeed-show-entry) + (org-capture nil "n") + (yank) + (org-capture-finalize)) + + (defface elfeed-face-tag-reddit + '((t :foreground "#ffb9a0")) + "This is a custom font face for the F1 tag in Elfeed.") + + (push '(f1 elfeed-face-tag-reddit) + elfeed-search-face-alist) + + (defun yt-dl-it (url) + "Downloads the URL in an async shell" + (let ((default-directory "~/desktop/videos")) + (async-shell-command (format "youtube-dl \"%s\"" url)))) + + (defun elfeed-youtube-dl (&optional use-generic-p) + "Youtube-DL link" + (interactive "P") + (let ((entries (elfeed-search-selected))) + (cl-loop for entry in entries + do (elfeed-untag entry 'unread) + when (elfeed-entry-link entry) + do (yt-dl-it it)) + (mapc #'elfeed-search-update-entry entries) + (unless (use-region-p) (forward-line)))) + + (define-key elfeed-search-mode-map (kbd "d") 'elfeed-youtube-dl) + (use-package elfeed-org :command (elfeed-org) :config