#!/usr/bin/env sh url="$(xclip -o -selection clipboard)" log="$(mktemp)" cmd="mpv -quiet $url 2>&1 > $log" echo "$cmd" eval "$cmd" || notify-send "$url" "$(cat "$log")"