Lines Matching +full:num +full:- +full:columns

8 # Build-Depends on xvfb and xauth.
10 set -e
12 PROGNAME=xvfb-run
16 XVFBARGS="-screen 0 1280x1024x24"
17 LISTENTCP="-nolisten tcp"
20 # Query the terminal to establish a default number of columns to use for
22 # the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the
26 *[!0-9]*|'') DEFCOLUMNS=80 ;;
31 echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
41 if [ -n "$*" ]; then
48 -a --auto-servernum try to get a free server number, starting at
49 --server-num
50 -e FILE --error-file=FILE file used to store xauth errors and Xvfb
52 -f FILE --auth-file=FILE file used to store auth cookie
54 -h --help display this usage message and exit
55 -n NUM --server-num=NUM server number to use (default: $SERVERNUM)
56 -l --listen-tcp enable TCP port listening in the X server
57 -p PROTO --xauth-protocol=PROTO X authority protocol name to use
59 -s ARGS --server-args=ARGS arguments (other than server number and
60 "-nolisten tcp") to pass to the Xvfb server
65 # Find a free server number by looking at .X*-lock files in /tmp.
73 while [ -f /tmp/.X$i-lock ]; do
81 if [ -e "$AUTHFILE" ]; then
84 if [ -n "$XVFB_RUN_TMPDIR" ]; then
85 if ! rm -r "$XVFB_RUN_TMPDIR"; then
90 if [ -n "$XVFBPID" ]; then
96 ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
97--long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-ar…
98 --name "$PROGNAME" -- "$@")
101 if [ $GETOPT_STATUS -ne 0 ]; then
106 eval set -- "$ARGS"
110 -a|--auto-servernum) SERVERNUM=$(find_free_servernum); AUTONUM="yes" ;;
111 -e|--error-file) ERRORFILE="$2"; shift ;;
112 -f|--auth-file) AUTHFILE="$2"; shift ;;
113 -h|--help) SHOWHELP="yes" ;;
114 -n|--server-num) SERVERNUM="$2"; shift ;;
115 -l|--listen-tcp) LISTENTCP="" ;;
116 -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
117 -s|--server-args) XVFBARGS="$2"; shift ;;
118 -w|--wait) shift ;;
119 --) shift; break ;;
132 if [ -z "$*" ]; then
137 if ! command -v xauth >/dev/null; then
147 if [ -z "$AUTHFILE" ]; then
148 XVFB_RUN_TMPDIR="$(mktemp -d -t $PROGNAME.XXXXXX)"
157 while [ $tries -gt 0 ]; do
158 tries=$(( $tries - 1 ))
159 XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
165 … (trap '' USR1; exec Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP -auth $AUTHFILE >>"$ERRORFILE" 2>&1) &
169 if kill -0 $XVFBPID 2>/dev/null; then
171 elif [ -n "$AUTONUM" ]; then
172 # The display is in use so try another one (if '-a' was specified).
186 set -e