#!/bin/sh

# $Progeny: xinitrc,v 1.10 2002/06/10 18:42:42 branden Exp $

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11

xsetroot -cursor_name watch

if xsetroot -solid darkslateblue; then
    echo "Setting root window to solid darkslateblue." >&2
else
    echo "Can't set the root window to a solid color!  What's going on?" >&2
fi

# XXX: pretty kludgey...
BITMAP=/etc/configlets/root_window.xbm
FALLBACK=yes
DEPTH=$(xdpyinfo | grep 'depth of root window' | cut -d: -f2 | sed -e 's/ //g' -e 's/planes//')
if [ -n "$DEPTH" ]; then
    if [ $DEPTH -gt 4 ]; then
        IMAGEFILE=$(ls /etc/configlets/root_window.* | grep -v '\.xbm$' | head -1)
        if [ -n "$IMAGEFILE" ]; then
            if xsetbg $IMAGEFILE; then
                echo "Using $IMAGEFILE as root window." >&2
                FALLBACK=
            fi
        fi
    fi
fi

if [ -n "$FALLBACK" ]; then
    if [ -e $BITMAP ]; then
        if X11xsetroot -bitmap $BITMAP; then
            echo "Using $BITMAP as root window." >&2
        fi
    fi
fi

fvwm2 -f /etc/configlets/fvwm2rc &

xsetroot -cursor_name left_ptr

configlets-druid

if which do-apt-cdrom > /dev/null && which gnome-tasksel > /dev/null; then
    if do-apt-cdrom; then
        gdialog --title "Run GNOME task selector?" --yesno \
'If you wish, the GNOME task selector can be run now.  This will permit
you to install Debian packages corresponding to certain usage profiles,
such as Japanese localization, games, or software development in the C
language.

Otherwise, you can skip this step and do packge management at a later
time, or using a different tool.

Would you like to use the GNOME task selector now?' 20 70
        case $? in
        0) gnome-tasksel ;;
        *) ;;
        esac
    fi
fi

gdialog --title "System Configuration Complete" --msgbox \
'System configuration has been completed.  Enjoy your new Debian GNU/Linux system!' 10 90

# vim:ai:et:sts=4:sw=4:tw=0:
