Why Perl here ?

Dr. Joel M. Hoffman joel "at" exc.com
Fri, 27 Mar 1998 13:57:00 +0000


>Does this mean you have a working bourne shell vncserver script and if so
>would you care to post it somewhere ?

I use a bourne shell script to launch Xvnc, never having learned Perl
properly.  It's not fancy, not as elegant as the perl script that
comes with Xvnc, but here's what I use:

#!/bin/sh
#
# vncserver.
#
# This only works if you already know the DISPLAY you want to use.
#
# The pid gets put in ~/.vnc/pid, so you can use:
#  kill `cat ~/.vnc/pid` to kill Xvnc.

# Set the display here:
DISPLAY=:1 ; export DISPLAY

# set the fontpath here:
FONTPATH=/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/more75dpi/

# 16 bpp.  You might want to use 8.  (Does 8 even work?)
DEPTH=16

# Set the geometry here
GEO=800x600

#Where do you keep your passwd file? [YOU MUST SET THIS!]
AUTH=~/.vnc/passwd

#Do you use http?  [I don't --- I can't get the Java stuff to compile.]
HTTP=~/.vnc/

#Other options go here
OPTS="-co /usr/lib/X11/rgb -rfbauth $AUTH -httpd $HTTP"


/usr/X11R6/bin/Xvnc -fp $FONTPATH $DISPLAY -depth $DEPTH -geometry $GEO $OPTS &
echo $! > /acc/joel/.vnc/pid
sleep 3

/usr/bin/X11/xsetroot -solid grey

/usr/bin/X11/fvwm -disp $DISPLAY &
sleep 1

# no need to launch xterms, because you can do that from within fvwm.