#!/bin/bash

sudo rm /var/armax/drivers/touch/3M/10-evdev.conf.tmp

read -r -d '' text<<EVDEV_CONF 
Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        MatchProduct    "3M 3M USB Touchscreen - EX II"
        Driver "evdev"
        Option "SwapAxes" "1"
        Option "InvertX" "0"
        Option "InvertY" "0"
EndSection

Section "InputClass"                                                                                                                                                                  
        Identifier "evdev touchscreen catchall"                                                                                                                                       
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        MatchProduct    "eGalax Inc."
        Driver "evdev"
        Option "SwapAxes" "1"
        Option "InvertX" "0"
        Option "InvertY" "0"
EndSection 
EVDEV_CONF
echo "$text"> /var/armax/drivers/touch/3M/10-evdev.conf.tmp
sudo cp /var/armax/drivers/touch/3M/10-evdev.conf.tmp /usr/share/X11/xorg.conf.d/10-evdev.conf -f
sudo rm /usr/share/X11/xorg.conf.d/99-calibration.conf -f
sudo reboot





