#!/bin/csh -f
###############################################################################
#                    SOFTIMAGE's .xsession STARTUP FILE                       #
#     This file contains all the clients one wishes to have automatically     #
#     be invoked upon startup of the window environment during the login      #
#     phase.  This file is nothing more than a simple shell script.  For      #
#     those users familiar with the NeWS window manager, this file can be     #
#     thought of as the equivalent implementation of user.ps.                 #
###############################################################################

# set XENVIRONMENT: this resource file is read by each application at startup.
setenv XENVIRONMENT $HOME/.Xdefaults

# Xlib looks at the value of XUSERFILESEARCHPATH to find a dir of resource files
setenv XUSERFILESEARCHPATH "$HOME/%N:`/usr/bin/X11/appdefpath`"


# Call xdpyinfo and pipe it to awk looking for the pattern of dimensions.
# Once awk finds the dimensions of the current screen, write the results to
# a file called .xscreen to make the variable know to both the parent and
# child shells.  You may want other shells and programs to know about it
xdpyinfo | awk ' /dimensions/ {print "setenv XSCREEN " $2 > ".xscreen" }'

# source the file so that the variable is known to this shell
source .xscreen

# pause for the source to take place
wait &

# To display clients from remote machines back to your own console
/usr/bin/X11/xhost +


# start the window manager
/usr/bin/X11/4Dwm&
/usr/bin/X11/wait4wm


# Now go ahead and start up the xwsh's
setenv CONSOLE true 
/usr/sbin/xwsh -title SOFTIMAGE -icontitle SOFTIMAGE -bg grey20 -geometry 80x30+15-15 -fn -schumacher-clean-medium-r-normal--15-150-75-75-c-90-iso8859-1



# set some user preferences using the XSET(1) utility
xset fp+ /usr/lib/fmfonts -art 40 -ari 3 &


# make a user_defined-textured root-window background 

set test_os_version = `uname -r`
if ( $test_os_version != "5.2" )
if ($XSCREEN == '1024x768') then
	bgpaste -t 0 0 10 -o 0 700 ~/.icons/soft_1024.sgi
endif

if ($XSCREEN == '1280x1024') then
	bgpaste -t 0 0 20 -o 0 956 ~/.icons/soft_1280.sgi 
endif
endif


# Execute the standard toolchest
/usr/bin/X11/toolchest &

# Start the console window
/usr/sbin/startconsole -iconic

# For managing the xdm session
/usr/bin/X11/reaper

#
#
# END
#
#
