Merge branch 'master' of gitlab.com:chriscochrun/dotfiles
This commit is contained in:
commit
21ea41028d
14 changed files with 228 additions and 70 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue