#! /bin/sh
#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: Xclients,v 1.160 1999/04/14 09:29:33 vltsccm Exp $" 
#
# Xclients  (.xclients)
#
# who        when      what
# ---------  --------  ----------------------------------------------
# G.FILIPPI  18/08/93  created 
# G.FILIPPI  12/09/93  changed to /vlt/System/X11/bitmaps/NTT
# G.FILIPPI  09/12/93  adapted to SunSolaris 2
#

#-----------------------------------------------------------------------
# CREDITS: 
#     T.MELEN and C.OUNNAS for the previous .xclients
#
#-----------------------------------------------------------------------

#************************************************************************
#   NAME
#   xclients, Xclients  -  X environment Home Session definition at login time.
#
#   SYNOPSIS
#   $HOME/.xclients
#   /vlt/System/Xclients
#
#   DESCRIPTION
#
#   This file is part of the VLT environment. It allows each user to 
#   define the appearance of the screen after the login.
#
#   This script should be executed by $HOME/.xsession, that is automatically 
#   called by xdm each time a login is performed (see also CAUTIONS). 
#
#   You have two possibilities:
#
#     - using the default Home Session. 
#       If you have no .xclients file in your HOME directory, the default 
#       file /vlt/System/Xclients is invoked by default by the 
#       standard .xsession 
#       The default Home Session is made of:
#         - Motif window manager
#         - two xterm (one iconized),
#         - one digital clock (lower right corner)
#         - the mailbox flag  (upper right corner)
#         - the xman top menu (aside of the mailbox flag)
#         - the logout button (iconized)
#
#    - having your own Home Session.
#      Make a local copy of the the standard file
#              $ cp /vlt/System/Xclients $HOME/.xclients
#      and edit it according to your taste. You need to do this if you want
#      more or less clients at startup or if you want to change same basic
#      features of the terminal: bell, background, mouse, and a like.
#      
#
#   This file is meaningfull only on "xdm" environment, at present used only
#   on SUN Solaris 1. 
#
#   On HP this functionality is performed using the Style Manager, part of 
#   the VUE. On HP:
#      - put up on the screen the client(s) that you want to have each time
#        you log in (called the Home Session)
#      - invoke the Style Manager and select "Startup"
#      - press "Set Home Session ...", this record your current screen
#      - enable "Return to Home Session" in the "At Login" menu.
#      - press OK to store your choices.
#   At each login, the Home Session will be recreated.
#
#   FILES
#   $HOME/.xsession             startup session script searched by xdm
#   /vlt/System/Xsession        VLT default startup session script
#   /vlt/System/pseudo-xlogout  logout script
#
#   ENVIRONMENT
#
#   RETURN VALUES
#   
#   CAUTIONS
#
#   this is not a standard X file, so it is up the $HOME/.xsession 
#   procedure to call it. Either you are using the standard procedure
#   ($HOME/.xsession->/vlt/System/Xsession) or be sure that your file 
#   invokes .xsession or /vlt/System/Xession or contains the appropriate
#   commands to start and set up the window manager and the clients you want.
#
#   This should be an executable script. Be sure the "x" permission is 
#   given and that the first line of the file defines the shell to be
#   used:    #! /bin/ssss      ssss = sh, ksh, csh, tcsh .
#  
#   Do 'sleep 1' (or more) after starting a client to reduce trashing.
#   Use detach for local clients and rcmd for remote clients that you
#   don't want to delete before beeing logged out.
#
#   EXAMPLES
#
#   SEE ALSO
#   X(1)
#   O'Reilly & Ass. - The X Window System - vol.3 - User's Guide
#   
#   BUGS     
#------------------------------------------------------------------------

#----------------------------------------------------------------------------
#
# Set the root window pattern/color
#
xsetroot -fg grey40 -bg grey72 -bitmap /vlt/System/X11/bitmaps/NTT     

xset b 25 50 200                 # setting the bell (volume, pitch and duration)
xset s on                        # enabling screen saver
xset s 600 600                   # setting screen saver duration (10 minutes)

#----------------------------------------------------------------------------
# Start up Motif window manager
#
mwm &
sleep 5

#----------------------------------------------------------------------------
# Start local clients: they must be started as detached processes:
#----------------------------------------------------------------------------

#----------------------------------------------------------------------------
# "Terminals"
#
xterm -ls -n "xterm@$HOST"			-geometry 80x40+210+140 &
sleep 1

#    - One local xterm should be started with the option -C if on console
#
if [ -n "$console" ]
then
    xterm -iconic -ls -n "Console@$HOST" -C	-geometry +4-4 &
else
    xterm -iconic -ls -n "xterm@$HOST"      -geometry +4-4 &
fi
sleep 1

#----------------------------------------------------------------------------
# Digital clock (screen lower right corner)
#

xclock -geometry -0-0 &
sleep 1

#----------------------------------------------------------------------------
# The "Control panel" clients (alligned on the screen upper right corner)
#
#    . . ............................ 
#          +-----+-----+-----+-----+:
#          |xeyes|xload|xman |xbiff|:
#          +-----+-----+-----+-----|: 
#  width =  < 80>+<150>+<110>+<100> :
#  height = 70
#  xoff = relative to window right edge (-) (borders count 10)
#  yoff = relative to window top edge   (+)
#



xman   -geometry -125+0 &
sleep 1

# xload -geometry -258+0 &
# sleep 1

# xeyes -geometry -432+0 &
# sleep 1

#----------------------------------------------------------------------------
# Other local clients

#emacs						-geometry +106+300 &
#sleep 1

#xcalendar+					-geometry -24-24 &
#sleep 1

#xcalendar					-geometry -4-4 &
#sleep 1


#----------------------------------------------------------------------------
# Mail flag from the mail host
#
if [ `hostname` = "te1" ]
then 
    xbiff  -geometry  100x70-0+0 &
    sleep 1
else
    rsh te1 -n xbiff  -geometry  100x70-0+0  -display $DISPLAY &
fi

#----------------------------------------------------------------------------
# Start remote clients, if any
#

# rcmd te7 xload -update 1 -geometry 150x88+790+4 &
#sleep 1

#----------------------------------------------------------------------------
# WAITING FOR THE COMPLETION SIGNAL
#  This create an iconized client. Closing (or killing)
#  this process means logging out.
#
if [ `uname -r` = "4.1.3" ]
then
    #----------------------------------------------------------------------------
    # on SunOS Solaris 1, start a the nicer "logout" process. 
    xlogout

else
    #----------------------------------------------------------------------------
    # use the home made one for other systems.
    #
    xterm -iconic \
          -name Logout\
          -title 'Logout Button'\
          -fg yellow \
          -fn Lucidasanstypewriter-bold-18\
          -e /vlt/System/xlogout
fi

#
exit 0

#___oOo___
