Blame | Last modification | View Log | RSS feed
#!/bin/bash# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This# copyrighted material is made available to anyone wishing to use, modify,# copy, or redistribute it subject to the terms and conditions of the# GNU General Public License version 2.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.GSESSION="$(which gnome-session 2>/dev/null)"STARTKDE="$(which startkde 2>/dev/null)"# check to see if the user has a preferred desktopPREFERRED=if [ -f /etc/sysconfig/desktop ]; then. /etc/sysconfig/desktopif [ "$DESKTOP" = "GNOME" ]; thenPREFERRED="$GSESSION"elif [ "$DESKTOP" = "KDE" ]; thenPREFERRED="$STARTKDE"fifiif [ -n "$PREFERRED" ]; thenexec "$PREFERRED"fi# now if we can reach here, either no desktop file was present,# or the desktop requested is not installed.if [ -n "$GSESSION" ]; then# by default, we run GNOME.exec "$GSESSION"elif [ -n "$STARTKDE" ]; then# if GNOME isn't installed, try KDE.exec "$STARTKDE"fi# We should also support /etc/X11/xinit/Xclients.d scriptsXCLIENTS_D=/etc/X11/xinit/Xclients.dif [ -d "$XCLIENTS_D" -a "$#" -eq 1 -a -x "$XCLIENTS_D/Xclients.$1.sh" ]; thenexec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"fi# Failsafe.# these files are left sitting around by TheNextLevel.rm -f $HOME/Xrootenv.0# Argh! Nothing good is installed. Fall back to twm{# gosh, neither fvwm95 nor fvwm2 is available;# fall back to failsafe settings[ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'if [ -x /usr/bin/xclock ] ; then/usr/bin/xclock -geometry 100x100-5+5 &elif [ -x /usr/bin/xclock ] ; then/usr/bin/xclock -geometry 100x100-5+5 &fiif [ -x /usr/bin/xterm ] ; then/usr/bin/xterm -geometry 80x50-50+150 &fiif [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then/usr/bin/firefox /usr/share/doc/HTML/index.html &fiif [ -x /usr/bin/twm ] ; thenexec /usr/bin/twmfi}