From d63c351679504d8e15b8fc4d4b58ca10e48a5239 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 12 Aug 2020 02:10:32 +0200 Subject: Improved opener interfacing slightly --- opener | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'opener') diff --git a/opener b/opener index 06f0c52..320ff7f 100755 --- a/opener +++ b/opener @@ -1,4 +1,5 @@ #!/bin/sh +ORIGIN_VIEW="?" while getopts f: opt; do case $opt in f) ORIGIN_VIEW=$OPTARG;; @@ -14,12 +15,13 @@ case "$1" in *) echo "\e[31m$1\e[0m $2 $3" >&2; exit 1;; esac if [ $VIEWER = $ORIGIN_VIEW ]; then - echo $@ + echo "$2 $3" exit 0 else case $VIEWER in - zathura | sxiv | less) exec $VIEWER $3;; - \./*) exec $VIEWER $3 $2;; + zathura | sxiv | less) setsid $VIEWER $3;; + \./viewhtml) setsid $VIEWER $3 $2;; + *) echo "\e[31m$VIEWER\e[0m $@" >$2; exit 1;; esac fi -exit 1 +exit 0 -- cgit v1.1