diff options
-rw-r--r-- | .emacs.d/modules/thanos-multimedia.el | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/.emacs.d/modules/thanos-multimedia.el b/.emacs.d/modules/thanos-multimedia.el index 232b33f..b81ac40 100644 --- a/.emacs.d/modules/thanos-multimedia.el +++ b/.emacs.d/modules/thanos-multimedia.el @@ -36,8 +36,10 @@ emms-player-mpv-parameters '("--no-video") emms-info-functions '(emms-info-native) emms-playlist-buffer-name "*Music*" - emms-source-file-default-directory "~/Music/jazz") + emms-source-file-default-directory "~/Music") + (define-key 'thanos/applications-map (kbd "e") 'emms) + (define-key emms-playlist-mode-map (kbd "A") 'emms-add-directory-tree) ;; yeetube @@ -87,18 +89,33 @@ prompt blank to keep the default name." url name)))))) (when is-zeus - (load-file "~/Developer/yeetube.el/yeetube.el")) + (load-file "~/Developer/emacs-lisp/yeetube.el/yeetube.el")) (require 'yeetube) (setf yeetube-results-limit 30 yeetube-mpv-disable-video t) +(defun yeetube-play-url (url) + "Open URL using yeetube-player." + (interactive "sURL:") + (let ((media-player (executable-find (symbol-name yeetube-player)))) + (unless media-player + (error (format "%s not found." media-player))) + (when (string-prefix-p "http" url) + (setf yeetube-last-played url) + (if (eq yeetube-player 'mpv) + (yeetube-start-mpv-process url) + (yeetube-start-process + (format "%s \"%s\"" media-player + (replace-regexp-in-string "\\byewtu\\.be\b" "youtube.com" url))))))) + (define-prefix-command 'thanos/yeetube) (global-set-key (kbd "C-c y") 'thanos/yeetube) (define-key thanos/yeetube (kbd "s") 'yeetube-search) (define-key thanos/yeetube (kbd "b") 'yeetube-play-saved-video) (define-key thanos/yeetube (kbd "d") 'yeetube-download-videos) (define-key thanos/yeetube (kbd "p") 'yeetube-mpv-toggle-pause) +(define-key thanos/yeetube (kbd "v") 'yeetube-mpv-toggle-no-video-flag) (define-key thanos/yeetube (kbd "C-p") 'yeetube-mpv-toggle-video) (define-key thanos/yeetube (kbd "k") 'yeetube-remove-saved-video) (define-key thanos/yeetube (kbd "u") 'yeetube-change-platform) |