From b1dfa42349a97ab327e51b875f5af8a562680e72 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 30 Apr 2020 21:38:36 +0100 Subject: [PATCH] Adds script to handle different types of link from newsboat --- bin/.bin/linkhandler | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/.bin/linkhandler diff --git a/bin/.bin/linkhandler b/bin/.bin/linkhandler new file mode 100755 index 00000000..ed82efd7 --- /dev/null +++ b/bin/.bin/linkhandler @@ -0,0 +1,20 @@ +#!/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 + +notify-send "I get here" + +url="$1" +browser="${BROWSER:-firefox-developer-edition}" + +notify-send "Opening" "$url" + +case "$url" in + *"//invidio.us/"*) open-youtube "$url"; exit 0 ;; + *) $browser "$url"; exit 0 ;; +esac + +exit 1