From 8e9f8f2d0dcdddec35091ddbbdc79650763ec922 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 19:56:50 +0200 Subject: Adding upstream version 2.9.0dev.6. Signed-off-by: Daniel Baumann --- samples/keepviewer | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 samples/keepviewer (limited to 'samples/keepviewer') diff --git a/samples/keepviewer b/samples/keepviewer new file mode 100755 index 0000000..f5c0b2c --- /dev/null +++ b/samples/keepviewer @@ -0,0 +1,20 @@ +#!/bin/sh +# This script can be invoked as a wrapper for an external viewer by lynx, e.g., +# given this line in lynx.cfg +# XLOADIMAGE_COMMAND:keepviewer xli %s & +# it will invoke xli on a hardlink to the file (which is assumed to be in the +# temporary directory created by lynx), and clean up when the viewer exits. +# +# Parameters: +# $1 is viewer +# $2 is filename +if test $# = 2 ; then + chmod 600 $2 + myfile=`echo $2 | sed -e 's@\(.*/tmp/\)\([^/]*/\)\?\(.*\)@\1my\3@'` + ln $2 $myfile || exit 1 + trap "rm -f $myfile" 0 1 2 5 15 + eval $1 $myfile +else + echo "Usage: keepviewer " + exit 1 +fi -- cgit v1.2.3