(defun red-web-play-this () "Starts a urxvt terminal with mpv playing search results from youtube for the region. Prompts whether to stream video, or just the audio" (interactive) (let ((search-term (buffer-substring-no-properties (mark) (point)))) (start-process "mpv-search" nil "/usr/bin/urxvtc" "-e" "sh" "-c" (concat "mpv ytdl://ytsearch5:" (shell-quote-argument search-term) (unless (y-or-n-p "video?") " --no-video ") (when (y-or-n-p "loop?") " --loop-file=inf ") " --keep-open=always --load-unsafe-playlists")))) (global-set-key (kbd "C-c m") 'red-web-play-this)