index rss mastodon twitter github linkedin email
Álvaro Ramírez
sponsor

Álvaro Ramírez

01 August 2022 dwim-shell-command video streams

I continue hunting for use-cases I can migrate to dwim-shell-command… After adding clipboard support (via ) I found one more.

  1. Copy URL from browser.
  2. Invoke dwim-shell-commands-mpv-stream-clipboard-url.
  3. Enjoy picture in picture from Emacs ;)

mpv.webp

What's the secret sauce? Very little. Invoke the awesome mpv with a wrapping function using dwim-shell-command-on-marked-files.

(defun dwim-shell-commands-mpv-stream-clipboard-url ()
  "Stream clipboard URL using mpv."
  (interactive)
  (dwim-shell-command-on-marked-files
   "Streaming"
   "mpv --geometry=30%x30%+100%+0% \"<<cb>>\""
   :utils "mpv"
   :no-progress t
   :error-autofocus t
   :silent-success t))

The typical progress bar kinda got in the way, so I added a new option :no-progress to dwim-shell-command-on-marked-files, so it can be used for cases like this one.