From e007e1c239f1b4667377ca4ce09e34fbbafd4c9d Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 15 Dec 2024 01:27:20 -0500 Subject: Moved rip-video / set-bg to elisp --- .config/emacs/modules/bd--browse.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '.config/emacs/modules/bd--browse.el') diff --git a/.config/emacs/modules/bd--browse.el b/.config/emacs/modules/bd--browse.el index 6a5d2ef..531c7b2 100644 --- a/.config/emacs/modules/bd--browse.el +++ b/.config/emacs/modules/bd--browse.el @@ -53,11 +53,18 @@ icecat, or eww." (list (bd/selector-bookmarks) (bd/selector-search))))) +(defun rip (url) + "Play URL (or search string) in mpv." + (interactive "sURL or search string: ") + (message "Ludu %s" url) + (start-process "rip" nil + "mpv" (concat (if (string-match "https://.*" url) + "ytdl://" + "ytdl://ytsearch:") url))) + (setopt browse-url-handlers `((,(regexp-opt '("youtube.com" "youtu.be")) . - (lambda (url &rest _) - (message "Ludu %s" url) - (start-process-shell-command "rip-video" nil (concat "rip-video " url))))) + (lambda (url &rest _) (rip url)))) url-privacy-level '(email os emacs lastloc cookies)) (use-package shr @@ -98,8 +105,8 @@ icecat, or eww." (t (funcall original url new-window)))) (advice-add 'eww :around 'bd/elpher) :custom - (elpher-use-tls t) (elpher-default-url-type "gemini") + (elpher-connection-timeout 120) (elpher-gemini-max-fill-width 85) (elpher-use-emacs-bookmark-menu t)) -- cgit v1.2.3