ext-sources/dtstart
author fujiwara
Wed, 04 Feb 2009 08:36:25 +0000
changeset 15009 9cd4a1ffe12d
parent 12873 598c05bd6a22
child 15016 8f2cbe0f65ce
permissions -rwxr-xr-x
2009-02-04 Takao Fujiwara <[email protected]> * SUNWdbus.spec: Updated to rename 0005.dbus. * SUNWgnome-dtlogin-integration.spec: Updated to add SUNWdesktop-startup * ext-sources/dtstart: Updated to work with xinitrc.d * ext-sources/0010.env: * ext-sources/0020.pre-localization: * ext-sources/0060.sockets: * ext-sources/0110.fonts: * ext-sources/0120.xrdb: * ext-sources/0210.im: Added * ext-sources/0070.dbus: Renamed * patches/SUNWgnome-dtlogin-integration-01-g11n-migration.diff: Added

#!/bin/bash
#
# Script for starting a desktop session
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

MYNAME=$(basename $0)

usage() {
    echo "Usage: $0 session_name"
    echo "This script is not designed to run directly."
    echo "Please use /etc/X11/gdm/Xsession instead."
}

if [ $# -ne 1 ]; then
    usage
    exit 1
fi

case "$1" in
    -h|--help|-\?)
        usage
        exit 0
    ;;
esac

SESSION_NAME="$1"
shift

case "$SESSION_NAME" in
gdm|GDM|gnome|GNOME|jds|JDS)
     SESSION_MANAGER=/usr/bin/gnome-session ;;
twm) SESSION_MANAGER=/usr/X11/bin/twm ;;
xdm) SESSION_MANAGER=/usr/openwin/lib/X11/xdm/Xsession ;;
console) exit 0 ;;
*)
    if [ "x$SESSION_NAME" != x ] ; then
        SESSION_MANAGER=$SESSION_NAME
    fi
    if [ ! -x $SESSION_NAME ] ; then
        echo "Not found your display manager."
        SESSION_MANAGER=/usr/X11/bin/twm
    fi

esac

exec $SESSION_MANAGER $@