#!/bin/sh
echo "Red Hat Linux `basename $0` 2.0"
echo "Copyright (C) 1999, 2000 Red Hat, Inc"
echo "Redistributable under the terms of the GNU General Public License"

kpanel=`/sbin/pidof kpanel`
good=1

if [ "$DISPLAY" != "" -a "$1" = "" ]; then
    if [ -n "$kpanel" -a -x /usr/bin/switchdesk-kde ]; then
	exec switchdesk-kde
    elif [ -x /usr/bin/switchdesk-gnome ]; then
	exec switchdesk-gnome
    elif [ -x /usr/bin/switchdesk-kde ]; then
	exec switchdesk-kde
    else
	echo "Desktop Switcher GUI unavailable.  Please install the switchdesk-kde package."
	good=0;
    fi
else
    good=0;
fi

if [ "$good" = "0" ]; then
    exec switchdesk-helper $1
fi
