Article Title           : vuelogin
Creation Date           : unknown
Author                  : unknown
Last Update             : 6-1-93
Expiration Rules        : 
Location              	: NCD-Articles/Host_Systems/HP
=============================================================================


This document gives summarized information about HP VUElogin, vuewm, 
and steps on how to use other window managers with VUElogin.

VUElogin
========

VUElogin is equivalent to xdm.  VUElogin is the display manager for
the HP X Window System. It will prompt you for the login and password.

VUElogin resources files are under /usr/lib/X11/vue/Vuelogin.

The VUElogin directory contains the following configuration files:

	Xstartup	A script runs as root after the user is verified.

	Xreset		A script runs as root after the session is 
			terminated but before the display is closed.

	Xresources	Responsible for the appearance and behavior 
			resources for the Vuelogin login screen.

	Xservers	Contains an entry to start the server on the 
			local display.  Not necessary for the NCD 
			display stations because they run XDMCP.  

	Xsession	Defines the values for the session resource.

	Xconfig		File used for setting Vuelogin configuration 
			parameters.
	
	Xerrors		File used to errors from Vuelogin

	Xpid		Contains an ASCII representation of the 
			process-id of the main vuelogin.


VUElogin uses the following default environment:


           DISPLAY        is set to the associated display name
           EDITOR         is set to /usr/bin/vi
           HOME           is set to the home directory of the user
           LANG           is set to the current NLS language (if any)
           LOGNAME        is set to the user name
           MAIL           is set to /usr/mail/$USER
           PATH           is set to the value of the userPath resource
           USER           is set to the user name
           SHELL          is set to the user's default shell 
			  (from /etc/passwd)            
	   TERM           is set to hpterm
           TZ             is set to the value of the timeZone resource
           XAUTHORITY     may be set to an authority file

Xsession and .vueprofile Files
===========================

You can use an Xsession file to set up the environment for all users 
that login via VUElogin.  Personal environment variables can be set in 
$HOME/.vueprofile.  Make sure that the Xsession file is executable.

The default Xsession file under /usr/lib/X11/vue/Vuelogin is shown
below:
#!/bin/ksh
#############################################################################
###
###   Xsession
###
###
###   Hewlett-Packard Visual User Environment, Version 2.0
###
###   Copyright (c) 1990 Hewlett-Packard Company
###
###   $Revision: 4.1 $
###
##############################################################################


##############################################################################
###
###
###  This script starts the user's session. It searches for one of three
###  types of startup mechanisms, in the following order:
###
###     VUE     existance of VUE Session Manager on the system
###     XDM     $HOME/.xsession  (executable)
###     xinit   $HOME/.x11start  (executable)
###
###  If none of these startup mechanisms exist, a default window manager and
###  terminal emulator client are started.
###
##############################################################################


##############################################################################
###
###  Standard output (stdout) and error (stderr) from clients started by
###  this script default to /dev/null
###
##############################################################################

    exec >/dev/null 2>/dev/null




##############################################################################
###
###  Global environment section
###
###   VUE pre-sets the following environment variables for each user.
###
###    (Xconfig)
###
###     DISPLAY   set to the value of the first field in the Xservers file.
###     HOME      set to the user's home directory (from /etc/passwd)
###     LANG      set to the display's current NLS language (if any)
###     PATH      set to the value of the Vuelogin "userPath" resource
###     USER      set to the user name
###     SHELL     set to the user's default shell (from /etc/passwd)
###     TZ        set to the value of the Vuelogin "timeZone" resource
###
###
###    (Xsession)
###
###     EDITOR    set to "/usr/bin/vi"
###     LOGNAME   set to the user name
###     MAIL      set to "/usr/mail/$USER"
###     TERM      set to hpterm
###
###
###   Three methods are available to modify or add to this list depending
###   on the desired scope of the resulting environment variable.
###
###     1. X server and/or all users on a display       (Xconfig file)
###     2. all users on a display                       (Xsession file)
###     3. individual users                             (.vueprofile file)
###
###   See VUE on-line help, the VUE Users Guide, or the Vuelogin(1X) man
###   page for details on setting environment variables.
###
###
##############################################################################

  EDITOR=/usr/bin/vi
  LOGNAME=$USER
  MAIL=/usr/mail/$USER
  TERM=hpterm

  export EDITOR LOGNAME MAIL TERM




##############################################################################
###
###  Xinitcolormap
###
###  The following invocation of xinitcolormap is necessary to support
###  Starbase clients.  If you are running Starbase clients you should
###  uncomment the line.
###
###  Xinitcolormap reads a colormap file and allocates the number of colors
###  listed in the colormap file.  Since it is the first client run in the
###  VUE environment, it allocates colors at the start of the X colormap and
###  before the HP VUE color server (in vuesession) allocates the colors it
###  desires.  See the xinitcolormap(1) man page for more information.
###
##############################################################################

#/usr/bin/X11/xinitcolormap


##############################################################################
###
###  Startup section.
###
###  The script first tries to determine the shell syntax (sh, ksh, or csh)
###  of .vueprofile by looking at it's first line. If it cannot be determined
###  it is assumed to be the same as the user's default shell. The chosen
###  startup mechanism is then invoked by the appropriate shell so the
###  environment in .vueprofile will be parsed correctly.
###
##############################################################################

   set +a

   VUEDIR=/usr/lib/X11/vue
   VUESESSION=$VUEDIR/etc/vuesession
   VUEHELLO=$VUEDIR/etc/vuehello
   PROFILE=.vueprofile


#
#  find the environment file...
#

  if [ ! -f $HOME/$PROFILE ]; then
    /bin/cp $VUEDIR/sys.vueprofile $HOME/$PROFILE
  fi

  if [ -f $HOME/$PROFILE ]; then
    profile=$HOME/$PROFILE
  else
    profile=
  fi


#
#  determine the shell syntax of the environment file...
#
#  look for "#!/bin/sh" type syntax on first line. Account for whitespace
#  and other parameters on the line.
#

  if [ $profile ]; then

    read shell shell1 shell2 < $profile

    if [ "$shell" = '#!' ]; then
      shell=$shell1
    fi

    shell=${shell##'#!'}

    case $shell in
      /bin/sh | /bin/ksh | /bin/csh ) ;;
      *                             ) shell=$SHELL ;;
    esac

  else
    shell=$SHELL
  fi



#
#  determine startup mechanism...
#

  if [ -x $VUESESSION ]; then
    startup=$VUESESSION
  else
    if [ -x $HOME/.xsession ]; then
      startup=$HOME/.xsession
  else
    if [ -f $HOME/.x11start ]; then
      startup=".x11start"
  else
      startup="hpterm -geometry 80x24+10+10"
    fi
    fi
  fi


#
#  start transition client...
#

  if [ $startup = $VUESESSION -a -x $VUEHELLO ]; then
    $VUEHELLO &
  fi


#
#  start up the session...
#


  if [ $profile ]; then

    case `/bin/basename $shell` in
      sh | ksh  ) exec $shell -c    ". $profile;      exec $startup" ;;
      csh       ) exec $shell -f -c "source $profile; exec $startup" ;;
      *         ) (echo ""; /bin/date
                   echo "Xsession: Non-standard shell $shell. Ignoring .vueprofile."
                  ) >> $HOME/.vue/errorlog
                  exec $startup ;;
    esac

  else
    exec $startup

  fi

#######################################################################


Vuewm
=====

The default window manager used with VUElogin is the HP VUE session 
manager: vuewm. 

Once vuewm is started, the .vue directory and the .vueprofile file will 
be created for you in your home directory.

.vue directory contains the following:


        apps            A directory that contains miscellaneous, 
			personal_apps, and system_apps

        emerson:0:      A directory that contains a directory
			called current which contains palette.vue, 
			vue.resources, vue.session, and vue.settings, 
			and palette.vue

        errrorlog       A file that contains vue errors.

        palettes        A directory that contains a file with your current 
			color selection.

        ncdu210:0       A directory that contains current, home, palette.vue

        types           A directory that contains tools directory.

.vueprofile: sets your personal environment variables.  An example of
.vueprofile file is shown below:

#############################################################################
###
###   .vueprofile
###
###   user personal environment variables
###
###   Hewlett-Packard Visual User Environment, Version 2.0
###
###   Copyright (c) 1990 Hewlett-Packard Company
###
###   $Revision: 4.1 $
###
#############################################################################
#!/bin/sh
#
# Load my individual X resources using xrdb
#
        /usr/bin/X11/xrdb -load /u0/mona/.Xdefaults
#
# Include the HPVUE fonts in my font path
#
        /usr/bin/X11/xset +fp /usr/lib/X11/ncd/fonts/hpvue

#######################################################################


NOTE:
=====
The vuewm Front Panel is an integral part of the vuewm.  Therefore, it 
will not be available with any other window manager.    However, the 
following are:  vuefile, vuestyle, vuehelp, vuesession, vuepath, and 
vueload.

Using Another Window Manager With Vuelogin:
===========================================

An alternate window manager can be used with vuelogin by setting the 
wmStartupCommand resource.  

For example, to use mwm with Vuelogin include the following in your 
.Xdefaults:

	Vuesession*wmStartupCommand: /usr/bin/X11/mwm

Copy sys.vueprofile from /usr/lib/X11/vue directory to your home 
directory as .vueprofile.

Include the following line in your .vueprofile:

	xrdb -load $HOME/.Xdefaults

This doesn't work with users who already have used vue and have a
$HOME/.vue directory.  If this already exists, set the resource
above in the user's $HOME/.vue/<display>/current/vue.resources
and $HOME/.vue/<display>/home/vue.resources  files.


Using NCDwm with VUElogin
=========================

Ncdwm can be used with Vuelogin, but it takes more work, since
we don't have the HP ncdwm binary file yet.  Once we have the HP ncdwm
binary, then ncdwm can be started from .Xdefaults file, see "Using
Another Window Managers With VUElogin" section above. Also, see
the note about users who already have a $HOME/.vue directory.

The only way I can do it now is to do the following:

        1. In your .Xdefaults add the following:

        Vuesession*wmStartupCommand:    /u0/mona/ncdwm_script

Note: Replace "/u0/mona" with your home directory, or other directory.

        2. In your $HOME directory, create ncdwm_script that contains the
        following:

        #!/bin/sh
        #
	NCDNAME=`echo $DISPLAY | sed -e 's/:0//'`  
        # Start NCDwm
        remsh $NCDNAME wm

        3.  While you are still running VUEwm, load $HOME/.Xdefaults file:

                xrdb -load $HOME/.Xdefaults

        4.  Log out.

        5.  Log back in, you should have the NCDwm running.

You will still get to use vuefile, vuestyle, vuehelp, vuesession, vuepath,
and vueload, but again vuewm Front Panel will not be available.


5/14/92 mb. 
1/26/93 mb.

