Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
3
# copyrighted material is made available to anyone wishing to use, modify,
4
# copy, or redistribute it subject to the terms and conditions of the
5
# GNU General Public License version 2.
6
#
7
# You should have received a copy of the GNU General Public License
8
# along with this program; if not, write to the Free Software
9
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
10
 
11
GSESSION="$(which gnome-session 2>/dev/null)"
12
STARTKDE="$(which startkde 2>/dev/null)"
13
 
14
# check to see if the user has a preferred desktop
15
PREFERRED=
16
if [ -f /etc/sysconfig/desktop ]; then
17
    . /etc/sysconfig/desktop
18
    if [ "$DESKTOP" = "GNOME" ]; then
19
	PREFERRED="$GSESSION"
20
    elif [ "$DESKTOP" = "KDE" ]; then
21
	PREFERRED="$STARTKDE"
22
    fi
23
fi
24
 
25
if [ -n "$PREFERRED" ]; then
26
    exec "$PREFERRED"
27
fi
28
 
29
# now if we can reach here, either no desktop file was present,
30
# or the desktop requested is not installed.
31
 
32
if [ -n "$GSESSION" ]; then
33
    # by default, we run GNOME.
34
    exec "$GSESSION"
35
elif [ -n "$STARTKDE" ]; then
36
    # if GNOME isn't installed, try KDE.
37
    exec "$STARTKDE"
38
fi
39
 
40
# We should also support /etc/X11/xinit/Xclients.d scripts
41
XCLIENTS_D=/etc/X11/xinit/Xclients.d
42
if [ -d "$XCLIENTS_D" -a "$#" -eq 1 -a -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
43
    exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
44
fi
45
 
46
# Failsafe.
47
 
48
# these files are left sitting around by TheNextLevel.
49
rm -f $HOME/Xrootenv.0
50
 
51
# Argh! Nothing good is installed. Fall back to twm
52
{
53
    # gosh, neither fvwm95 nor fvwm2 is available;
54
    # fall back to failsafe settings
55
    [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
56
 
57
    if [ -x /usr/bin/xclock ] ; then
58
	/usr/bin/xclock -geometry 100x100-5+5 &
59
    elif [ -x /usr/bin/xclock ] ; then
60
	/usr/bin/xclock -geometry 100x100-5+5 &
61
    fi
62
    if [ -x /usr/bin/xterm ] ; then
63
        /usr/bin/xterm -geometry 80x50-50+150 &
64
    fi
65
    if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then
66
	/usr/bin/firefox /usr/share/doc/HTML/index.html &
67
    fi
68
    if [ -x /usr/bin/twm ] ; then
69
	exec /usr/bin/twm
70
    fi
71
}