From 7fdc04e4d49d65fd67dd1b29dec207559d2d82d2 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 6 Jul 2021 06:48:09 -0500 Subject: [PATCH] Nyxt launches mpv with a hinted url now --- nyxt/init.lisp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nyxt/init.lisp b/nyxt/init.lisp index 0a06688..8affe85 100644 --- a/nyxt/init.lisp +++ b/nyxt/init.lisp @@ -25,15 +25,19 @@ ;; Create a function to launch mpv with given url (defun mpv (url) - "MPV launches with given url" - (uiop:run-program (list "mpv" url))) + "MPV launches with given url using the fast profile." + (uiop:run-program (list "mpv" "--profile=fast" url))) -;; Let's create a function to hint videos and play them in MPV +;; Let's create a function to hint videos, convert the url to a sting, and play them in MPV (define-command hint-mpv (&key nyxt/web-mode::annotate-visible-only-p) "Show a set of element hints, and copy the URL of the user inputted one." (nyxt/web-mode:query-hints "Copy element URL" (lambda (nyxt/web-mode::result) - (mpv nyxt/web-mode::result)) + ;; this converts the url to a string to be used in mpv + (let* ((url (format nil "~a" + (url (first nyxt/web-mode::result))))) + ;; here we take that string and pipe it into mpv + (mpv url))) :annotate-visible-only-p nyxt/web-mode::annotate-visible-only-p))