dtstart revision 15760
10139N/A#!/bin/bash
10139N/A#
10139N/A# Script for starting a desktop session
18540N/A#
10139N/A# CDDL HEADER START
10139N/A#
10139N/A# The contents of this file are subject to the terms of the
17185N/A# Common Development and Distribution License, Version 1.0 only
10139N/A# (the "License"). You may not use this file except in compliance
16880N/A# with the License.
18603N/A#
17178N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10139N/A# or http://www.opensolaris.org/os/licensing.
16880N/A# See the License for the specific language governing permissions
10139N/A# and limitations under the License.
20330N/A#
12578N/A# When distributing Covered Code, include this CDDL HEADER in each
10139N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18615N/A# If applicable, add the following below this CDDL HEADER, with the
10139N/A# fields enclosed by brackets "[]" replaced with your own identifying
18525N/A# information: Portions Copyright [yyyy] [name of copyright owner]
18151N/A#
18151N/A# CDDL HEADER END
18977N/A#
18970N/A#
17797N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
20307N/A# Use is subject to license terms.
17797N/A#
16880N/A
17733N/AMYNAME=$(basename $0)
17797N/A
17753N/Ausage() {
16880N/A echo "Usage: $0 session_name"
17089N/A echo "This script is not designed to run directly."
17797N/A echo "Please use /etc/X11/gdm/Xsession instead."
18159N/A}
18159N/A
16880N/Aif [ $# -ne 1 ]; then
16880N/A usage
16880N/A exit 1
17733N/Afi
16880N/A
17089N/Acase "$1" in
17073N/A -h|--help|-\?)
17089N/A usage
17733N/A exit 0
17074N/A ;;
17089N/Aesac
20333N/A
18683N/ASESSION_NAME="$1"
20307N/Ashift
18683N/A
17535N/Acase "$SESSION_NAME" in
18683N/Agdm|GDM|gnome|GNOME|jds|JDS)
17733N/A SESSION_MANAGER=/usr/bin/gnome-session ;;
17733N/Atwm) SESSION_MANAGER=/usr/X11/bin/twm ;;
18559N/Axdm) SESSION_MANAGER=/usr/openwin/lib/X11/xdm/Xsession ;;
18940N/Aconsole) exit 0 ;;
17733N/A*)
17672N/A if [ "x$SESSION_NAME" != x ] ; then
18940N/A SESSION_MANAGER=$SESSION_NAME
17858N/A fi
18940N/A if [ ! -x $SESSION_NAME ] ; then
17884N/A echo "Not found your display manager."
17884N/A SESSION_MANAGER=/usr/X11/bin/twm
18940N/A fi
18212N/A
18940N/Aesac
18287N/A
18940N/Aexec $SESSION_MANAGER $@
20307N/A
18940N/A