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