2
0

dtloadresources.src 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. XCOMM!KORNSHELL
  2. XCOMM $XConsortium: dtloadresources.src /main/6 1996/04/23 18:51:41 drk $
  3. XCOMM (c) Copyright 1996 Digital Equipment Corporation.
  4. XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
  5. XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
  6. XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
  7. XCOMM (c) Copyright 1993,1994,1996 Novell, Inc.
  8. XCOMM (c) Copyright 1996 FUJITSU LIMITED.
  9. XCOMM (c) Copyright 1996 Hitachi.
  10. #define HASH #
  11. XCOMM ##########################################################################
  12. XCOMM #
  13. XCOMM # File: dtsession_res
  14. XCOMM #
  15. XCOMM # Default Location: /usr/dt/bin/dtsession_res
  16. XCOMM #
  17. XCOMM # Purpose: Load the RESOURCE_MANAGER with desktop resources
  18. XCOMM #
  19. XCOMM # Description: This script is invoked to load or reload the
  20. XCOMM # RESOURCE_MANAGER from the desktop resource files.
  21. XCOMM #
  22. XCOMM # Invoked by: The desktop Session Manager at session startup,
  23. XCOMM # or user by means of 'dtaction LoadResources'.
  24. XCOMM # This script should not be invoked directly.
  25. XCOMM #
  26. XCOMM # Product: @(#)Common Desktop Environment 1.0
  27. XCOMM #
  28. XCOMM # (c) Copyright 1993, 1994 Hewlett-Packard Company
  29. XCOMM # (c) Copyright 1993, 1994 International Business
  30. XCOMM # Machines Corp.
  31. XCOMM # (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  32. XCOMM # (c) Copyright 1993, 1994 Unix System Labs, Inc.,
  33. XCOMM # a subsidiary of Novell, Inc.
  34. XCOMM #
  35. XCOMM # Note: Please do not modify this file.
  36. XCOMM # Later product updates will overwrite this file.
  37. XCOMM #
  38. XCOMM ##########################################################################
  39. Msg()
  40. {
  41. HASH
  42. HASH $1 - message catalog number
  43. HASH $2 - fallback message text
  44. HASH
  45. echo "$2"
  46. HASH dspmsg dtsession_res.cat -s 1 $1 "$2"
  47. }
  48. Usage()
  49. {
  50. HASH
  51. HASH $1 - message catalog number
  52. HASH
  53. Msg 1 "dtsession_res -load|-merge [-system] [-xdefaults] [-file <name>]"
  54. case $1 in
  55. needArgs) Msg 2 "Option -load or -merge must be specified";;
  56. xrdbOptDone) Msg 3 "Option -load or -merge already specified";;
  57. needFile) Msg 4 "Missing <filename> after -file option";;
  58. unknownArg) Msg 5 "Unknown option specified";;
  59. HASH needOption);; # this is the Usage statement above
  60. esac
  61. exit 1
  62. }
  63. XCOMM
  64. XCOMM Parse options
  65. XCOMM
  66. if [ $# -eq 0 ]; then
  67. Usage needArgs
  68. fi
  69. #ifdef sun
  70. rOWsystem=$OPENWINHOME/lib/Xdefaults
  71. rOWdefaults=$HOME/.OWdefaults
  72. #endif
  73. rFactory=CDE_INSTALLATION_TOP/config/$LANG/sys.resources
  74. rFactoryC=CDE_INSTALLATION_TOP/config/C/sys.resources
  75. rCustom=CDE_CONFIGURATION_TOP/config/$LANG/sys.resources
  76. rXdefaults=$HOME/.Xdefaults
  77. xrdbOption=""
  78. resourceFiles=""
  79. while [ $# -gt 0 ]; do
  80. case $1 in
  81. -load|-merge)
  82. HASH
  83. HASH xrdb option specified
  84. HASH
  85. if [ ! -z "$xrdbOption" ]; then
  86. Usage xrdbOptDone
  87. fi
  88. xrdbOption=$1
  89. ;;
  90. -system)
  91. HASH
  92. HASH locate system resources
  93. HASH
  94. #ifdef sun
  95. if [ -r "$rOWsystem" ]; then
  96. resourceFiles="$resourceFiles $rOWsystem"
  97. fi
  98. #endif
  99. if [ -r "$rFactory" ]; then
  100. resourceFiles="$resourceFiles $rFactory"
  101. elif [ -r "$rFactoryC" ]; then
  102. resourceFiles="$resourceFiles $rFactoryC"
  103. fi
  104. HASH
  105. HASH Locate customized system resources
  106. HASH
  107. if [ -r "$rCustom" ]; then
  108. resourceFiles="$resourceFiles $rCustom"
  109. fi
  110. ;;
  111. -xdefaults)
  112. HASH
  113. HASH Locate .Xdefaults
  114. HASH
  115. if [ -r "$rXdefaults" ]; then
  116. resourceFiles="$resourceFiles $rXdefaults"
  117. fi
  118. #ifdef sun
  119. if [ -r "$rOWdefaults" ]; then
  120. resourceFiles="$resourceFiles $rOWdefaults"
  121. fi
  122. #endif
  123. ;;
  124. -file)
  125. HASH
  126. HASH Locate specified file
  127. HASH
  128. shift
  129. if [ -z "$1" ]; then
  130. Usage needFile
  131. fi
  132. if [ -r "$1" ]; then
  133. resourceFiles="$resourceFiles $1"
  134. fi
  135. ;;
  136. *) Usage unknownArg;;
  137. esac
  138. shift
  139. done
  140. if [ -z "$xrdbOption" ]; then
  141. Usage needOption
  142. fi
  143. XCOMM converts ":0" to "0", but leaves "pablo:0" as is
  144. display=${DISPLAY##:}
  145. XCOMM converts "blanco.flexicat.com:0.0" to "blanco_flexicat_com_0"
  146. display=$(echo ${display%.*} | /usr/bin/tr ".:" "__")
  147. (
  148. echo "dtsession_res*files: $resourceFiles"
  149. if [ ! -z "$resourceFiles" ]; then
  150. cat $resourceFiles
  151. fi
  152. ) | XRDB -quiet $xrdbOption -DDISPLAY_$display