#!/bin/sh
# $XConsortium: Xsetup_0,v 1.3 93/09/28 14:30:31 gildea Exp $
#xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
#
# Add background by Kocil, 2003-12-28

# Fix backspace problem in login box:
PATH="/usr/bin:/usr/X11R6/bin:/usr/local/bin"

sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
if [ -f $sysmodmap ]; then
   /usr/X11R6/bin/xmodmap $sysmodmap
fi

# The background image
BACKGROUND=/usr/share/wallpapers/default_login.jpg

if [ -f $BACKGROUND ]; then
  # Use xv or xloadimage to set the background

  if which Esetroot &> /dev/null ; then
    Esetroot -scale $BACKGROUND
  elif which chbg &> /dev/null; then
    chbg -once -effect 0 -mode maximize $BACKGROUND
  elif which xv &> /dev/null; then
    xv -max -smooth -root -quit $BACKGROUND
  elif loadimage &> /dev/null; then                                       
    xloadimage -onroot -fullscreen $BACKGROUND
  else
    # no luck, only color then
    xsetroot -solid SteelBlue
  fi
else
    xsetroot -solid SteelBlue
fi

# TOY
if which xpenguins1 &> /dev/null; then
    xpenguins1 -n 8 &
elif which xsnow &> /dev/null; then
    xsnow &
fi

