Added elfeed function for streaming video with MPV
This commit is contained in:
@@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
(use-package elfeed
|
(use-package elfeed
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:config
|
||||||
|
(defun elfeed-play-with-mpv ()
|
||||||
|
"Open the current elfeed entry link with mpv."
|
||||||
|
(interactive)
|
||||||
|
(let* ((entry (if (eq major-mode 'elfeed-show-mode)
|
||||||
|
elfeed-show-entry
|
||||||
|
(elfeed-search-selected :ignore-region)))
|
||||||
|
(url (and entry (elfeed-entry-link entry))))
|
||||||
|
(if url
|
||||||
|
(progn
|
||||||
|
(message "Opening with mpv: %s" url)
|
||||||
|
(start-process "mpv" nil "mpv" url))
|
||||||
|
(message "No URL found"))))
|
||||||
|
(define-key elfeed-search-mode-map (kbd "v") #'elfeed-play-with-mpv)
|
||||||
|
(define-key elfeed-show-mode-map (kbd "v") #'elfeed-play-with-mpv)
|
||||||
:custom
|
:custom
|
||||||
(elfeed-enclosure-default-dir "~/Downloads/")
|
(elfeed-enclosure-default-dir "~/Downloads/")
|
||||||
(elfeed-search-remain-on-entry t)
|
(elfeed-search-remain-on-entry t)
|
||||||
@@ -25,3 +40,4 @@
|
|||||||
|
|
||||||
(with-eval-after-load 'elfeed
|
(with-eval-after-load 'elfeed
|
||||||
(elfeed-org))
|
(elfeed-org))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user