A generic touchscreen calibration program for X.Org
Revision | 0204ed22a6c2d1087beadaaf39f3f6d710fb7043 (tree) |
---|---|
Time | 2012-03-08 18:24:47 |
Author | Tias Guns <tias@ulys...> |
Commiter | Tias Guns |
Merge pull request #33 from koenkooi/master
Fixes needed to make the calibration script work on a Beagleboard running Angstrom
@@ -6,18 +6,26 @@ | ||
6 | 6 | # |
7 | 7 | # original script: Martin Jansa <Martin.Jansa@gmail.com>, 2010-01-31 |
8 | 8 | # updated by Tias Guns <tias@ulyssis.org>, 2010-02-15 |
9 | +# updated by Koen Kooi <koen@dominion.thruhere.net>, 2012-02-28 | |
10 | + | |
11 | +PATH="/usr/bin:$PATH" | |
9 | 12 | |
10 | 13 | BINARY="xinput_calibrator" |
11 | 14 | CALFILE="/etc/pointercal.xinput" |
12 | 15 | LOGFILE="/var/log/xinput_calibrator.pointercal.log" |
13 | 16 | |
14 | 17 | if [ -e $CALFILE ] ; then |
15 | - echo "Using calibration data stored in $CALFILE" | |
16 | - . $CALFILE | |
17 | -else | |
18 | - CALDATA=`$BINARY -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` | |
19 | - if [ ! -z "$CALDATA" ] ; then | |
20 | - echo $CALDATA > $CALFILE | |
21 | - echo "Calibration data stored in $CALFILE (log in $LOGFILE)" | |
18 | + if grep replace $CALFILE ; then | |
19 | + echo "Empty calibration file found, removing it" | |
20 | + rm $CALFILE | |
21 | + else | |
22 | + echo "Using calibration data stored in $CALFILE" | |
23 | + . $CALFILE && exit 0 | |
22 | 24 | fi |
23 | 25 | fi |
26 | + | |
27 | +CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` | |
28 | +if [ ! -z "$CALDATA" ] ; then | |
29 | + echo $CALDATA > $CALFILE | |
30 | + echo "Calibration data stored in $CALFILE (log in $LOGFILE)" | |
31 | +fi |