/usr/share/worker/scripts/xliwrapper_worker is in worker-data 3.8.2-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | #! /bin/sh
#
# Copyright (C) 2005 Tobias Toedter <t.toedter@gmx.net>
# Portability changes by Ralf Hoffmann <ralf@boomerangsworld.de>
# Copyright (C) 2014 Ralf Hoffmann <ralf@boomerangsworld.de>
# merge with displaywrapper_worker
#
# This file is part of worker.
#
# Worker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Worker is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Worker; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# we require exactly seven arguments to the script
if [ $# != 7 ]; then
echo "This is the $0 program. It belongs to the worker filemanager."
echo " This is not a standalone program. It will normally be called from"
echo " worker to display pictures in it."
echo " The arguments are:"
echo " 1. X-coordinate"
echo " 2. Y-coordinate"
echo " 3. Width of the area"
echo " 4. Height of the area"
echo " 5. Hex-number of the window"
echo " 6. The filename to show"
echo " 7. The background color in X11-format"
echo
exit
fi
xli_mode=0
display_mode=0
if [ $(basename "$0") = "xliwrapper_worker" ]; then
if $(which xli >/dev/null 2>/dev/null); then
xli_mode=1
elif $(which display >/dev/null 2>/dev/null); then
display_mode=1
fi
elif [ $(basename "$0") = "displaywrapper_worker" ]; then
if $(which display >/dev/null 2>/dev/null); then
display_mode=1
elif $(which xli >/dev/null 2>/dev/null); then
xli_mode=1
fi
fi
if [ "$xli_mode" -eq 1 ]; then
pic_info=$(xli -identify "$6")
width=$(echo $pic_info | sed -ne "s/.* is a \([0-9]*\)x\([0-9]*\).*/\1/p")
height=$(echo $pic_info | sed -ne "s/.* is a \([0-9]*\)x\([0-9]*\).*/\2/p")
if [ -z "$width" -o -z "$height" ]; then
exit
fi
if [ "$width" -gt 0 -a "$height" -gt 0 ]; then
x_zoom_factor=$(expr \( $3 \* 100 \) / $width)
y_zoom_factor=$(expr \( $4 \* 100 \) / $height)
if [ $x_zoom_factor -gt $y_zoom_factor ]; then
zoom_factor=$y_zoom_factor
else
zoom_factor=$x_zoom_factor
fi
if [ $zoom_factor -lt 1 ]; then
zoom_factor=1
fi
result_x=$(expr \( $1 \* 100 \) / $zoom_factor )
result_y=$(expr \( $2 \* 100 \) / $zoom_factor )
result_width=$(expr \( $3 \* 100 \) / $zoom_factor + 1 )
result_height=$(expr \( $4 \* 100 \) / $zoom_factor + 1 )
xli -quiet -border $7 -clip $result_x,$result_y,$result_width,$result_height -zoom $zoom_factor -windowid 0x$5 "$6"
fi
elif [ "$display_mode" -eq 1 ]; then
d=$(which display 2>/dev/null)
if test -n "$d"; then
e=$(identify -ping "$6" 2>/dev/null)
if test -n "$e"; then
display -geometry $3x$4+$1+$2 -foreground "$7" -window 0x$5 "$6" >/dev/null 2>/dev/null
fi
fi
fi
|