A lot of awesome changes and trying to use kmonad

This commit is contained in:
Chris Cochrun 2021-08-14 09:43:52 -05:00
parent 7fdc04e4d4
commit f51ff07986
18 changed files with 246 additions and 80 deletions

View file

@ -28,6 +28,11 @@
"MPV launches with given url using the fast profile."
(uiop:run-program (list "mpv" "--profile=fast" url)))
;; Create a function to download videos with youtube-dl in alacritty
(defun youtube-dl (url)
"Download videos and audio with youtube-dl in alacritty for feedback"
(uiop:run-program (list "alacritty" "-e" "youtube-dl" "-o ~/Videos/%(title)s.%(ext)s" url)))
;; 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."
@ -41,6 +46,19 @@
:annotate-visible-only-p
nyxt/web-mode::annotate-visible-only-p))
;; Let's create a function to hint videos, convert the url to a sting, and download with ytdl
(define-command hint-ytdl (&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)
;; 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
(youtube-dl url)))
:annotate-visible-only-p
nyxt/web-mode::annotate-visible-only-p))
;; These are my own keys that are layered over vi-normal. A lot of these
;; are similar to qutebrowser.
(defvar *chris-keymap* (make-keymap "chris-map"))
@ -49,6 +67,7 @@
"J" 'switch-buffer-previous
"b" 'switch-buffer
"v" 'hint-mpv
"C-v v" 'hint-ytdl
"d" 'delete-current-buffer
"D" 'delete-buffer
"r" 'reload-current-buffer