home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
TEDdesk
/
reloc.8
/
$TED_DIR
/
bin
/
dtsession_res
< prev
next >
Wrap
Text File
|
1998-08-19
|
4KB
|
163 lines
#!/bin/ksh
# * *
# * (c) Copyright 1994, 1995 TriTeal Corporation *
# * (c) Copyright 1993, 1994 Hewlett-Packard Company *
# * (c) Copyright 1993, 1994 International Business Machines Corp. *
# * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
# * (c) Copyright 1993, 1994 Novell, Inc. *
# *
#############################################################################
###
### File: dtsession_res
###
### Default Location: /usr/dt/bin/dtsession_res
###
### Purpose: Load the RESOURCE_MANAGER with desktop resources
###
### Description: This script is invoked to load or reload the
### RESOURCE_MANAGER from the desktop resource files.
###
### Invoked by: The desktop Session Manager at session startup,
### or user by means of 'dtaction LoadResources'.
### This script should not be invoked directly.
###
### Product: @(#)TED 4.2 Alpha 99-4200-00, dtsession_res 1.00
###
### (c) Copyright 1994, 1995 TriTeal Corporation
### (c) Copyright 1993, 1994 Hewlett-Packard Company
### (c) Copyright 1993, 1994 International Business
### Machines Corp.
### (c) Copyright 1993, 1994 Sun Microsystems, Inc.
### (c) Copyright 1993, 1994 Unix System Labs, Inc.,
### a subsidiary of Novell, Inc.
###
### Note: Please do not modify this file.
### Later product updates will overwrite this file.
###
### Revision: $XConsortium: dtloadresources.src /main/cde1_maint/3 1995/10/03 17:03:58 gtsang $
###
#############################################################################
Msg()
{
#
# $1 - message catalog number
# $2 - fallback message text
#
echo "$2"
#dspmsg dtsession_res.cat -s 1 $1 "$2"
}
Usage()
{
#
# $1 - message catalog number
#
Msg 1 "dtsession_res -load|-merge [-system] [-xdefaults] [-file <name>]"
case $1 in
needArgs) Msg 2 "Option -load or -merge must be specified";;
xrdbOptDone) Msg 3 "Option -load or -merge already specified";;
needFile) Msg 4 "Missing <filename> after -file option";;
unknownArg) Msg 5 "Unknown option specified";;
#needOption);; #this is the Usage statement above
esac
exit 1
}
#
# Parse options
#
if [ $# -eq 0 ]; then
Usage needArgs
fi
rFactory=/usr/dt/config/$LANG/sys.resources
rFactoryC=/usr/dt/config/C/sys.resources
rCustom=/etc/dt/config/$LANG/sys.resources
rXdefaults=$HOME/.Xdefaults
xrdbOption=""
resourceFiles=""
while [ $# -gt 0 ]; do
case $1 in
-load|-merge)
#
# xrdb option specified
#
if [ ! -z "$xrdbOption" ]; then
Usage xrdbOptDone
fi
xrdbOption=$1
;;
-system)
#
# locate system resources
#
if [ -r "$rFactory" ]; then
resourceFiles="$resourceFiles $rFactory"
elif [ -r "$rFactoryC" ]; then
resourceFiles="$resourceFiles $rFactoryC"
fi
#
# Locate customized system resources
#
if [ -r "$rCustom" ]; then
resourceFiles="$resourceFiles $rCustom"
fi
;;
-xdefaults)
#
# Locate .Xdefaults
#
if [ -r "$rXdefaults" ]; then
resourceFiles="$resourceFiles $rXdefaults"
fi
;;
-file)
#
# Locate specified file
#
shift
if [ -z "$1" ]; then
Usage needFile
fi
if [ -r "$1" ]; then
resourceFiles="$resourceFiles $1"
fi
;;
*) Usage unknownArg;;
esac
shift
done
if [ -z "$xrdbOption" ]; then
Usage needOption
fi
#converts ":0" to "0", but leaves "pablo:0" as is
display=${DISPLAY##:}
#converts "blanco.flexicat.com:0.0" to "blanco_flexicat_com_0"
display=$(echo ${display%.*} | /usr/bin/tr ".:" "__")
(
echo "dtsession_res*files: $resourceFiles"
if [ ! -z "$resourceFiles" ]; then
cat $resourceFiles
fi
) | /usr/bin/X11/xrdb -quiet $xrdbOption -DDISPLAY_$display