summaryrefslogtreecommitdiff
path: root/opener
diff options
context:
space:
mode:
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