summaryrefslogtreecommitdiff
path: root/opener
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2020-08-12 02:10:32 +0200
committerAki <please@ignore.pl>2020-08-12 02:10:32 +0200
commitd63c351679504d8e15b8fc4d4b58ca10e48a5239 (patch)
treefcdde953cb6e95c98a778e5754c72c09688937b1 /opener
parent5d31df6d7334845c286200f7430cdee13bc0d1d5 (diff)
downloadbrowse-d63c351679504d8e15b8fc4d4b58ca10e48a5239.zip
browse-d63c351679504d8e15b8fc4d4b58ca10e48a5239.tar.gz
browse-d63c351679504d8e15b8fc4d4b58ca10e48a5239.tar.bz2
Improved opener interfacing slightly
Diffstat (limited to 'opener')
-rwxr-xr-xopener10
1 files changed, 6 insertions, 4 deletions
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