Dotfiles/bin/.bin/linkhandler
Jonathan Hodgson 0d357e8f9e Makes linkhandler handle more
It now handles some peertube, more invidious and xkcd
2020-09-19 11:12:34 +01:00

20 lines
526 B
Bash
Executable file

#!/usr/bin/env bash
# A script to open urls
# For example, open images with sxiv
# This is necesary becuase environment variables are lost when calling from newsboat for some reason
url="$1"
browser="${BROWSER:-firefox-developer-edition}"
case "$url" in
*"//invidious.*/"*) open-youtube "$url"; exit 0 ;;
*//*.youtube.*/*) open-youtube "$url"; exit 0 ;;
*"//videos.*"*) open-youtube "$url"; exit 0 ;;
*"//xkcd.com/"*) xkcd "$url"; exit 0 ;;
*) $browser "$url"; exit 0 ;;
#*) notify-send "$url"; exit ;;
esac
exit 1