15760N/A#!/bin/sh
15760N/A#
15760N/A# CDDL HEADER START
15760N/A#
15760N/A# The contents of this file are subject to the terms of the
15760N/A# Common Development and Distribution License, Version 1.0 only
15760N/A# (the "License"). You may not use this file except in compliance
15760N/A# with the License.
15760N/A#
15760N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
15760N/A# or http://www.opensolaris.org/os/licensing.
15760N/A# See the License for the specific language governing permissions
15760N/A# and limitations under the License.
15760N/A#
15760N/A# When distributing Covered Code, include this CDDL HEADER in each
15760N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15760N/A# If applicable, add the following below this CDDL HEADER, with the
15760N/A# fields enclosed by brackets "[]" replaced with your own identifying
15760N/A# information: Portions Copyright [yyyy] [name of copyright owner]
15760N/A#
15760N/A# CDDL HEADER END
15760N/A#
15760N/A#
15760N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
15760N/A# Use is subject to license terms.
15760N/A#
15760N/A
15760N/A
15760N/ADT_BINPATH=/usr/dt/bin
15760N/AXPREFIXES='
15760N/A/usr/X11
15760N/A/usr/openwin
15760N/A'
15760N/A
15760N/ALING=${LC_CTYPE:-"$LC_ALL"}
15760N/ALING=${LING:-"$LANG"}
15760N/ALING=${LING:-"C"}
15760N/A
15760N/Afor XPATH in $XPREFIXES
15760N/Ado
15760N/A if [ -x $XPATH/bin/xset ] && [ x$XSET = x ] ; then
15760N/A XSET=$XPATH/bin/xset
15760N/A fi
15760N/A if [ -f $XPATH/lib/locale/$LING/OWfontpath ] && [ x$OWFONTPATH = x ] ; then
15760N/A OWFONTPATH=$XPATH/lib/locale/$LING/OWfontpath
15760N/A fi
15760N/Adone
15760N/A
15760N/AXSET=${XSET:-"xset"}
15760N/AOWFONTPATH=${OWFONTPATH:-"/usr/openwin/lib/locale/$LING/OWfontpath"}
15760N/A
15760N/A# Copied from /usr/dt/bin/Xsession
15760N/A# ###########################################################################
15760N/A#
15760N/A# Append desktop font aliases to font path
15760N/A#
15760N/A# ###########################################################################
15760N/A
15760N/A
15760N/AADDFONTPATH_LOCAL() {
15760N/A # Combine lines together to make arguments for the xset command
15760N/A FP=`/usr/bin/awk '
15760N/A BEGIN { fp="fp+ " }
15760N/A /^[ ]*$/ { fp=" +fp " ; continue }
15760N/A { printf("%s%s", fp, $0) ; fp="," } ' $1`
15760N/A if [ -n "$FP" ]; then
15760N/A eval "$XSET $FP"
15760N/A fi
15760N/A}
15760N/A
15760N/AADDFONTPATH_REMOTE() {
15760N/A /usr/bin/nawk ' BEGIN {
15760N/A fp=" fp+ "
15760N/A }
15760N/A /^[ ]*$/ {
15760N/A fp=" +fp " ; continue }
15760N/A {cmd = sprintf("%s%s%s%s",XSET,fp, $0," 1>/dev/null");
15760N/A system(cmd); } ' $1
15760N/A}
15760N/A
15760N/A
15760N/A#
15760N/A# Reset Xserver font path to its default values
15760N/A#
15760N/A
15760N/A$XSET fp default
15760N/A
15760N/A
15760N/A# Append desktop font paths. Note: these directories should be
15760N/A# accessable by the X server. The file precedence is:
15760N/A#
15760N/A# /etc/dt/config/xfonts/C
15760N/A# /usr/dt/config/xfonts/C
15760N/A# /etc/dt/config/xfonts/$LING
15760N/A# /usr/dt/config/xfonts/$LING
15760N/A#
15760N/A
15760N/Aif [ "$DTXSERVERLOCATION" != "remote" -o "$XSERVERLOCATION" != "remote" ]; then
15760N/A
15760N/A #
15760N/A # Since X server is local, optimize by checking local desktop
15760N/A # font directories and making one call to xset.
15760N/A #
15760N/A if [ -r $OWFONTPATH ]; then
15760N/A ADDFONTPATH_LOCAL $OWFONTPATH
15760N/A fi
15760N/A
15760N/A if [ -f /etc/dt/config/xfonts/C/fonts.dir ]; then
15760N/A fontpath=/etc/dt/config/xfonts/C
15760N/A fi
15760N/A
15760N/A if [ -f /usr/dt/config/xfonts/C/fonts.dir ]; then
15760N/A if [ "x$fontpath" = x ]; then
15760N/A fontpath=/usr/dt/config/xfonts/C
15760N/A else
15760N/A fontpath=$fontpath,/usr/dt/config/xfonts/C
15760N/A fi
15760N/A fi
15760N/A
15760N/A if [ "$LING" != "C" ]; then
15760N/A if [ -f /etc/dt/config/xfonts/$LING/fonts.dir ]; then
15760N/A if [ "x$fontpath" = x ]; then
15760N/A fontpath=/etc/dt/config/xfonts/$LING
15760N/A else
15760N/A fontpath=$fontpath,/etc/dt/config/xfonts/$LING
15760N/A fi
15760N/A fi
15760N/A
15760N/A if [ -f /usr/dt/config/xfonts/$LING/fonts.dir ]; then
15760N/A if [ "x$fontpath" = x ]; then
15760N/A fontpath=/usr/dt/config/xfonts/$LING
15760N/A else
15760N/A fontpath=$fontpath,/usr/dt/config/xfonts/$LING
15760N/A fi
15760N/A fi
15760N/A fi
15760N/A
15760N/A if [ "x$fontpath" != x ]; then
15760N/A $XSET fp+ $fontpath
15760N/A fi
15760N/Aelse
15760N/A #
15760N/A # Since X server not local, we don't know if the desktop font
15760N/A # directories exist on the X server machine, so we have to
15760N/A # set them one at a time.
15760N/A #
15760N/A if [ -r $OWFONTPATH ]; then
15760N/A ADDFONTPATH_REMOTE $OWFONTPATH
15760N/A fi
15760N/A
15760N/A $XSET fp+ /etc/dt/config/xfonts/C 1>/dev/null
15760N/A $XSET fp+ /usr/dt/config/xfonts/C 1>/dev/null
15760N/A
15760N/A if [ "$LING" != "C" ]; then
15760N/A $XSET fp+ /etc/dt/config/xfonts/$LING 1>/dev/null
15760N/A $XSET fp+ /usr/dt/config/xfonts/$LING 1>/dev/null
15760N/A fi
15760N/A
15760N/A #
15760N/A # Append Font Server to tail of path.
15760N/A # Will server any "-dt-" fonts not found on the remote machine.
15760N/A #
15760N/A if [ -x /usr/openwin/bin/fs ]; then
15760N/A Hostname=`/usr/bin/hostname`
15760N/A dom=`/usr/bin/domainname`
15760N/A FS_HOSTNAME=''
15760N/A
15760N/A if [ ! -z "$dom" ]; then
15760N/A dom=".`echo $dom | /usr/bin/cut -d. -f2-`"
15760N/A fi
15760N/A
15760N/A if [ -x /usr/bin/getent ] && \
15760N/A /usr/bin/getent ipnodes "${Hostname}" > /dev/null 2>&1; then
15760N/A FS_HOSTNAME=`/usr/bin/getent ipnodes "${Hostname}" | \
15760N/A /usr/bin/head -1 | /usr/bin/cut -f1`
15760N/A elif /usr/sbin/ping "${Hostname}${dom}" 1 > /dev/null 2>&1; then
15760N/A FS_HOSTNAME="${Hostname}${dom}"
15760N/A fi
15760N/A
15760N/A if [ -z "$FS_HOSTNAME" ] || \
15760N/A ! /usr/sbin/ping "$FS_HOSTNAME" 1 >/dev/null 2>&1
15760N/A then
15760N/A FS_HOSTNAME="${Hostname}"
15760N/A fi
15760N/A
15760N/A $XSET fp+ "tcp/${FS_HOSTNAME}:7100"
15760N/A fi
15760N/Afi
15760N/A