From ca17a42f63cb759abe4ca2fad860b5df10f97e7d Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 21 Nov 2023 09:53:14 -0600 Subject: [PATCH] tweaks to jinx and empv --- README.org | 20 ++++++++++++++++++-- init.el | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index d53d423a..6089b420 100644 --- a/README.org +++ b/README.org @@ -1937,7 +1937,10 @@ Jinx is an enchanted spell checker for emacs. I think I'll just turn it on globa :init (flyspell-mode -1) :config (flyspell-mode -1) :bind (("M-c" . jinx-correct) - ("C-M-$" . Jinx-Languages))) + ("C-M-$" . Jinx-Languages)) + :general + (general-def jinx-mode-map + "C-S-f" 'jinx-correct)) #+end_src ** Emoji @@ -4177,7 +4180,20 @@ With empv we can perhaps control mpv much more fine grainly and even search yout (defun chris/empv-yt-dlp () "Download the current video and and play it" (interactive) - (async-shell-command (concat "yt-dlp" " \"" (empv-youtube-results--current-video-url) "\""))) + (let* ((item (empv-youtube-results--current-item)) + (video-id (alist-get 'videoId item)) + (playlist-id (alist-get 'playlistId item)) + (title (alist-get 'title item)) + (url (format + "https://youtube.com/%s=%s" + (if video-id "watch?v" "playlist?list") + (or video-id playlist-id)))) + (async-shell-command (concat + "yt-dlp" " -o '/home/chris/vids/%(title)s.%(ext)s'" + " \"" url "\"")) + (let ((file (format "/home/chris/vids/%s.%s" title "webm"))) + (empv-play file)) + (message url))) (defun chris/empv-org-play-link (&optional link) "Play link in empv from either supplied link or link at point in org-mode" diff --git a/init.el b/init.el index 3c91456a..91363318 100644 --- a/init.el +++ b/init.el @@ -1533,7 +1533,10 @@ Optional BACKEND must be `re-reveal' or a backend derived from it." :init (flyspell-mode -1) :config (flyspell-mode -1) :bind (("M-c" . jinx-correct) - ("C-M-$" . Jinx-Languages))) + ("C-M-$" . Jinx-Languages)) + :general + (general-def jinx-mode-map + "C-S-f" 'jinx-correct)) (use-package emojify :ensure t @@ -3063,7 +3066,20 @@ targets." (defun chris/empv-yt-dlp () "Download the current video and and play it" (interactive) - (async-shell-command (concat "yt-dlp" " \"" (empv-youtube-results--current-video-url) "\""))) + (let* ((item (empv-youtube-results--current-item)) + (video-id (alist-get 'videoId item)) + (playlist-id (alist-get 'playlistId item)) + (title (alist-get 'title item)) + (url (format + "https://youtube.com/%s=%s" + (if video-id "watch?v" "playlist?list") + (or video-id playlist-id)))) + (async-shell-command (concat + "yt-dlp" " -o '/home/chris/vids/%(title)s.%(ext)s'" + " \"" url "\"")) + (let ((file (format "/home/chris/vids/%s.%s" title "webm"))) + (empv-play file)) + (message url))) (defun chris/empv-org-play-link (&optional link) "Play link in empv from either supplied link or link at point in org-mode"