/usr/share/worker/scripts/xeditor 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 | #! /bin/bash
#######################################################################
# xeditor
# Version: 1.2
# This script is used by worker to call a X editor
# Several editors are searched with vi in a xterm as fallback
# but the env variable WORKER_XEDITOR can force another editor
#
# written by Ralf Hoffmann 2005
# License: GPL V2 or later
# Worker: http://www.boomerangsworld.de/worker
#######################################################################
XEDITOR="xterm"
SEARCH_EDITORS="nedit gedit gvim jedit emacs xemacs xedit"
USE_EDITOR=""
LINE_ARG_TYPE="unknown"
if [ -z "$WORKER_XEDITOR" ]; then
for e in $SEARCH_EDITORS; do
p=$(which $e 2>/dev/null)
if [ -x "$p" ]; then
USE_EDITOR="$p"
case "$e" in
nedit)
LINE_ARG_TYPE="nedit"
;;
emacs|xemacs|gvim)
LINE_ARG_TYPE="emacs"
;;
esac
break
fi
done
else
USE_EDITOR="$WORKER_XEDITOR"
fi
LINE_NUMBER=""
if [ "$1" = "-line" ]; then
LINE_NUMBER="$2"
shift
shift
fi
if [ -n "$USE_EDITOR" ]; then
if [ -n "$LINE_NUMBER" ]; then
case "$LINE_ARG_TYPE" in
nedit)
"$USE_EDITOR" -line $LINE_NUMBER "$@"
;;
emacs)
"$USE_EDITOR" +$LINE_NUMBER "$@"
;;
*)
"$USE_EDITOR" "$@"
;;
esac
else
"$USE_EDITOR" "$@"
fi
else
"$XEDITOR" -e vi "$@"
fi
|