#!/bin/sh

# Decompress tar
tar xzvf fedora-12-0.4.tgz
cd fedora-12-0.4

# Backup config and xorg.conf
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
cp /usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi /usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi.old
cp ./10-x11-input.fdi /usr/share/hal/fdi/policy/10osvendor/

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

# Modify xorg.conf
Xorg -configure :1
cp ~/xorg.conf.new ./xorg.conf
./chgxorg
cp -f ./xorg.conf /etc/X11/xorg.conf

# restart hal
service haldaemon restart

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

