1 --- calibrate.sh.orig 2008-11-10 11:55:55.000000000 +0100
2 +++ calibrate.sh 2010-06-22 21:51:13.881328018 +0200
7 -EVCALIBRATE=`which ev_calibrate || echo ./ev_calibrate`
8 -UDI=$(hal-find-by-property --key input.x11_driver --string evtouch)
9 +EVCALIBRATE=/usr/lib/xf86-input-evtouch/ev_calibrate
11 -ZENITY=`which zenity`
12 -KDIALOG=`which kdialog`
13 -XDIALOG=`which Xdialog`
15 -INFO="You have selected to (re)calibrate your touchscreen.\n\n\
16 -Move your pen around all edges on the following screen.\n\n\
17 -If you are done and touched all edges, hit the enter key and wait until \
18 -the top left crosshair turns red.\nOnce you tap the red crosshair, \
19 -the next one will turn red going from the top left to the \
20 -bottom right.\nIf you miss a tap, the right mouse button will \
21 -take you back one step.\n\n\
22 -If you tapped the last (bottom right) crosshair, the program will \
23 -return to your session. Note that changes only take effect after \
24 -restarting the session."
26 -RESTARTINFO="Touchscreen calibration done\nPlease restart your \
27 -session to \nmake the changes take effect"
29 -FAILINFO="No evtouch capable device found, if you are sure you have \n\
30 -an evtouch capable touchscreen, please mail the \
31 -resulting file of the command \"lshal > evtouch_hal.out\" to the\n\
32 -ubuntu-mobile@lists.ubuntu.com mailing list, so support for your \
33 -device can be added."
35 -if [ -z "$UDI" ];then
36 - if [ -x "${ZENITY}" ]; then
37 - $ZENITY --info --text="${FAILINFO}"
38 - elif [ -x "${XDIALOG}" ]; then
39 - $XDIALOG --fill --msgbox "${FAILINFO}" 20 40
40 - elif [ -x "${KDIALOG}" ]; then
41 - $KDIALOG --msgbox "${FAILINFO}"
46 -if [ -x "${ZENITY}" ]; then
47 - $ZENITY --info --text="${INFO}"
48 -elif [ -x "${XDIALOG}" ]; then
49 - $XDIALOG --fill --msgbox "${INFO}" 30 40
50 -elif [ -x "${KDIALOG}" ]; then
51 - $KDIALOG --msgbox "${INFO}"
53 +INFO="You have selected to (re)calibrate your touchscreen.
54 +Move your pen around all edges on the following screen. If you are done and
55 +touched all edges, hit the enter key and wait until the top left crosshair
56 +turns red. Once you tap the red crosshair, the next one will turn red going
57 +from the top left to the bottom right. If you miss a tap, the right mouse
58 +button will take you back one step.
59 +If you tapped the last (bottom right) crosshair, the program will
60 +return to your session. Note that changes only take effect after
61 +restarting the session.
62 +Press enter to start."
64 +RESTARTINFO="Touchscreen calibration done. Please restart your
65 +session to make the changes take effect"
67 +FAILINFO="No evtouch capable device found."
69 +if ! [ -e /dev/input/evtouch_event ]; then
70 + echo -e "${FAILINFO}"
79 if [ -n "$DISPLAY" ]; then
81 echo "ev_calibrate not found exiting ..."
84 -echo "evalibrate located at $EVCALIBRATE"
85 +echo "ev_calibrate located at $EVCALIBRATE"
87 if [ -z "$XINIT" ]; then
88 echo "xinit not found exiting ..."
90 #xinit /usr/bin/ddd ev_calibrate -- /usr/X11R6/bin/X
91 echo "Starting calibration program..."
93 -hal-set-property --udi $UDI --key input.x11_options.calibrate --string "1"
95 +cat << EOF > /etc/X11/xorg.conf.d/90-evtouch.conf
96 +Section "InputDevice"
97 + Identifier "Evtouch TouchScreen"
99 + Option "Device" "/dev/input/evtouch_event"
100 + Option "DeviceName" "evtouchscreen"
101 + Option "ReportingMode" "Raw"
102 + Option "SendCoreEvents" "true"
103 + Option "AutoServerLayout" "on"
104 + Option "AccelerationProfile" "0"
105 + Option "Calibrate" "1"
109 +[ -d /etc/evtouch ] || mkdir /etc/evtouch
110 +cp /usr/share/xf86-input-evtouch/empty_cursor.xbm /
112 $XINIT $EVCALIBRATE -- $XSERVER $MYDPY -auth /dev/null
114 -hal-set-property --remove --udi $UDI --key input.x11_options.calibrate
115 +. /etc/evtouch/config
117 -invoke-rc.d --quiet xserver-xorg-input-evtouch start
118 +cat << EOF > /etc/X11/xorg.conf.d/90-evtouch.conf
119 +Section "InputDevice"
120 + Identifier "Evtouch TouchScreen"
122 + Option "Device" "/dev/input/evtouch_event"
123 + Option "DeviceName" "evtouchscreen"
124 + Option "MinX" "$MINX"
125 + Option "MinY" "$MINY"
126 + Option "MaxX" "$MAXX"
127 + Option "MaxY" "$MAXY"
128 + Option "ReportingMode" "Raw"
129 + Option "SendCoreEvents" "true"
130 + Option "AutoServerLayout" "on"
131 + Option "AccelerationProfile" "0"
135 -rm /tmp/ev_calibrate
136 +rm -rf /tmp/ev_calibrate /empty_cursor.xbm /etc/evtouch
138 +echo -e "${RESTARTINFO}"
140 -if [ -x "${ZENITY}" ]; then
141 - $ZENITY --info --text="${RESTARTINFO}"
142 -elif [ -x "${XDIALOG}" ]; then
143 - $XDIALOG --fill --msgbox "${RESTARTINFO}" 10 40
144 -elif [ -x "${KDIALOG}" ]; then
145 - $KDIALOG --msgbox "${RESTARTINFO}"