#!/usr/bin/env sh URL="$1" xdgopen="$(which --all xdg-open | tac | head --lines 1)" if [ "$URL" = "--help" ] then echo "Help here" exit 1 fi term() { footclient $@ || alacritty -e $@ } if echo "$URL" | grep -qE "https?://.*youtu" then mpv "$URL" else $xdgopen "$URL" # term w3m "$URL" fi