Skip to content

Instantly share code, notes, and snippets.

@prodisDown
prodisDown / mpv-from
Last active June 16, 2023 12:58
mpv shell script. Prepends first arg on each line of stdin, then launches mpv with resulting playlist. Uses neat trick with file descriptors and unlinked files.
#!/bin/sh
trap 'printf "(exit) mpv-from\n" >&2' EXIT
usage () {
printf '(usage) mpv-from <basepath> [mpv-args]\n'
}
test $# -ge 1 || {
printf '(error) not enough arguments\n' >&2
usage >&2