#!/bin/sh
# 
PATH=/usr/X11/local/bin:$PATH
export PATH
# Xsession startup
#

# get the number of bits per pixel
export BPP=`xdpyinfo | grep "depth of root" | gawk --compat '{print $5}'`

# get the $RES veriable set up as I will use this for background images
export RES=`xdpyinfo | grep dimensions | gawk --compat '{print$2}'`
case "$RES" in
640x480)
;;
800x600)
;;
1024x768)
;;
1152x900)
;;
1280x1024)
;;
*)
  xmessage "Your Resolution of $RES is unknown to me. I only know of 640x480, 800x600, 1024x768, 1152x900 and 1280x1024. I will assume 1280x1024."
  export RES="1280x1024"
;;
esac
# get the machine name
export HOST=`hostname`
# set the background Image name
export BGPIC="Enl"
# set the pointer & colours
export POINTER="ShadowArrow"
export POINTERFG="#000000"
export POINTERBG="#ffafad"

##############
#
# If you want to start things on loggin in, put them in here.
# Make sure they are followed by an &
#

#start up standard stuff like my xload
xload -nolabel -geometry 31x32+0+31 -update 5 -jumpscroll 1 &
# fix up that bloody delete key to bo backspace for netscape & motif progs
xmodmap -e "keycode 107=BackSpace"

#
#
##############

# set up the pointer
xsetroot -cursor \
/usr/local/enlightenment/pixmaps/cursors/"$POINTER".xbm \
/usr/local/enlightenment/pixmaps/cursors/"$POINTER"_mask.xbm \
-fg "$POINTERFG" -bg "$POINTERBG" &

# do different things depending on screen depth
case "$BPP" in
8*)
  /usr/local/enlightenment/scripts/setbg "$BGPIC" &
  cat .enlightenment/main > .erc
  cat .enlightenment/paths >> .erc
  cat .enlightenment/functions >> .erc 
  cat .enlightenment/actions >> .erc 
  cat .enlightenment/menus8 >> .erc 
  cat .enlightenment/styles >> .erc 
  cat .enlightenment/modules"$RES" >> .erc 
  enlightenment
;;
15*)
  /usr/local/enlightenment/scripts/setbg "$BGPIC" &
  cat .enlightenment/main > .erc
  cat .enlightenment/paths >> .erc
  cat .enlightenment/functions >> .erc 
  cat .enlightenment/actions >> .erc 
  cat .enlightenment/menus >> .erc 
  cat .enlightenment/styles >> .erc 
  cat .enlightenment/modules"$RES" >> .erc 
  enlightenment
;;
16*)
  /usr/local/enlightenment/scripts/setbg "$BGPIC" &
  cat .enlightenment/main > .erc
  cat .enlightenment/paths >> .erc
  cat .enlightenment/functions >> .erc 
  cat .enlightenment/actions >> .erc 
  cat .enlightenment/menus >> .erc 
  cat .enlightenment/styles >> .erc 
  cat .enlightenment/modules"$RES" >> .erc 
  enlightenment
;;
24*)
  /usr/local/enlightenment/scripts/setbg "$BGPIC" &
  cat .enlightenment/main > .erc
  cat .enlightenment/paths >> .erc
  cat .enlightenment/functions >> .erc 
  cat .enlightenment/actions >> .erc 
  cat .enlightenment/menus >> .erc 
  cat .enlightenment/styles >> .erc 
  cat .enlightenment/modules"$RES" >> .erc 
  enlightenment
;;
32*)
  /usr/local/enlightenment/scripts/setbg "$BGPIC" &
  cat .enlightenment/main > .erc
  cat .enlightenment/paths >> .erc
  cat .enlightenment/functions >> .erc 
  cat .enlightenment/actions >> .erc 
  cat .enlightenment/menus >> .erc 
  cat .enlightenment/styles >> .erc 
  cat .enlightenment/modules"$RES" >> .erc 
  enlightenment
;;
esac


