#!/bin/sh
##################################
#Change these two variables to the WM of your choice.
WMEXEC="$1"
[ "x$WMEXEC" != x ] ||  WMEXEC="startlxde1"
##################################
export DISPLAY=:0
# export TSLIB_TSDEVICE=/dev/input/event3
debbie-sue 'echo "chroot is now open!"'
debbie-sue '/usr/bin/Xephyr :1 -screen 800x480 -br -ac' &
while [ "x$PARWIN" = "x" ] ; do
  # wait for Xephyr window to appear
  export PARWIN=`wmctrl -l | grep -i "N/A Xephyr" | awk '{print $1}'`
done
echo "Xephyr window ID is ($PARWIN)"
DISPLAY=:1 ; debbie-sue "habak -mf /usr/share/fonts/truetype/DroidSans-Bold.ttf \
     -ht 'Ctrl-back to return to dashboard.'"
DISPLAY=:0 ; wmctrl -i -r $PARWIN -T 'Easy Debian'
wmctrl -i -r $PARWIN -b toggle,fullscreen
zenity --display=:0 --info --title="Information" --text="Welcome to Easy Debian LXDE. This window is needed to gain keyboard focus in LXDE." &
while [ "x$TWOWIN" = "x" ] ; do
  # wait for Zenity dialog to pop up...
  export TWOWIN=`wmctrl -l | grep -i Information | awk '{print $1}'`
done
sudo debian /sbin/qobi-wmhint-fix $PARWIN
debbie-sue /usr/bin/$WMEXEC
killall Xephyr
export DISPLAY=:0
