aboutsummaryrefslogblamecommitdiff
path: root/.local/bin/xdg-open
blob: 8cb094ec916994ebbd6e2aa5b03c226486f73d8c (plain) (tree)






















                                                        
#!/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