#!/bin/sh

# Decompress tar
tar xzvf ubuntu-10.10-0.2.tgz
cd ubuntu-10.10-0.2

# Backup xorg.conf
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
cp -f /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/10-evdev.conf.old

# Copy binaries 
cp ./LinearAp /usr/local/bin/
cp ./xfhiddrv_drv.so /usr/lib/xorg/modules/input/
chmod 777 /usr/local/bin/LinearAp

# Modify xorg.conf
Xorg -configure :1
cp ~/xorg.conf.new ./xorg.conf
chmod 777 ./chgxorg
./chgxorg
cp ./xorg.conf /etc/X11/xorg.conf
cp -f ./10-evdev.conf  /usr/share/X11/xorg.conf.d/

echo "Setup completed, please restart system to enable touch panel."

