#!/usr/bin/env sh tmp="/tmp/dmvids" dirs="${1:-$HOME/vids $HOME/dl}" choice="$(find -L $dirs 2> /dev/null | grep '^.\+\.\(webm\|mp4\|mpeg\|mkv\)$' | sort | tee "$tmp" | sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g" | commander -n -x)" file="$(sed -n "${choice}p" "$tmp")" [ -r "$file" ] || exit 1 mpv "$file"