dtstart revision 15824
10139N/A#!/bin/bash
10139N/A#
10139N/A# Script for starting a desktop session
12208N/A#
10139N/A# CDDL HEADER START
10139N/A#
10139N/A# The contents of this file are subject to the terms of the
10139N/A# Common Development and Distribution License, Version 1.0 only
10139N/A# (the "License"). You may not use this file except in compliance
10139N/A# with the License.
10139N/A#
12208N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10139N/A# or http://www.opensolaris.org/os/licensing.
10139N/A# See the License for the specific language governing permissions
10139N/A# and limitations under the License.
10139N/A#
11912N/A# When distributing Covered Code, include this CDDL HEADER in each
10139N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
10139N/A# If applicable, add the following below this CDDL HEADER, with the
10139N/A# fields enclosed by brackets "[]" replaced with your own identifying
10139N/A# information: Portions Copyright [yyyy] [name of copyright owner]
10139N/A#
10139N/A# CDDL HEADER END
10139N/A#
10139N/A#
11393N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
10243N/A# Use is subject to license terms.
12316N/A#
12316N/A
10139N/AMYNAME=$(basename $0)
10139N/A
10139N/Ausage() {
10139N/A echo "Usage: $0 session_name"
10139N/A echo " This script loads scripts in /etc/X11/xinit/xinitrc.d"
10139N/A echo " and runs a session manager."
11393N/A echo " session_name is gnome, twm or xdm"
10139N/A}
10139N/A
10139N/Aif [ $# -ne 1 ]; then
10139N/A usage
10139N/A exit 1
10139N/Afi
10139N/A
10139N/Acase "$1" in
10139N/A -h|--help|-\?)
10139N/A usage
10139N/A exit 0
10139N/A ;;
10139N/Aesac
10139N/A
10139N/ASESSION_NAME="$1"
10139N/Ashift
10139N/A
10139N/Acase "$SESSION_NAME" in
10139N/Agdm|GDM|gnome|GNOME|jds|JDS)
10139N/A SESSION_MANAGER=/usr/bin/gnome-session ;;
10139N/Atjds|TJDS|TrustedJDS|tgnome|TGNOME)
10139N/A SESSION_MANAGER='/usr/bin/gnome-session --trusted-session';;
10139N/Atwm|TWM) SESSION_MANAGER=/usr/X11/bin/twm ;;
10139N/Axdm|XDM) SESSION_MANAGER=/usr/openwin/lib/X11/xdm/Xsession ;;
10139N/Aconsole) exit 0 ;;
10139N/A*)
10139N/A if [ "x$SESSION_NAME" != x ] ; then
10139N/A SESSION_MANAGER=$SESSION_NAME
10243N/A fi
10139N/A if [ ! -x $SESSION_NAME ] ; then
10139N/A echo "Could not find session startup for $SESSION_NAME"
10139N/A SESSION_MANAGER=/usr/X11/bin/twm
10139N/A fi
10139N/A
10139N/Aesac
10139N/A
10139N/A# GDM slave sets DESKTOP_SESSION environment from .desktop file.
10139N/Aexport DESKTOP_SESSION=$SESSION_NAME
10139N/A
10139N/A# run all system xinitrc shell scripts.
10139N/Aif [ -d /etc/X11/xinit/xinitrc.d ]; then
10139N/A for i in /etc/X11/xinit/xinitrc.d/* ; do
10139N/A if [ -x "$i" ]; then
10139N/A . "$i"
10139N/A fi
10139N/A done
10139N/Afi
10139N/A
10139N/Aexec $SESSION_MANAGER $@
10139N/A
10139N/A