A generic touchscreen calibration program for X.Org
修订版 | 5b1572aabdb48ab27d12be2935b69a67466b8eb7 (tree) |
---|---|
时间 | 2010-02-16 07:13:25 |
作者 | Martin Jansa <Martin.Jansa@gmai...> |
Commiter | Tias Guns |
add script to calibrate only once and store calibration data for later
use
Original script by Martin Jansa, from the OE repository
@@ -0,0 +1,23 @@ | ||
1 | +#!/bin/sh | |
2 | +# script to make the changes permanent (xinput is called with every Xorg start) | |
3 | +# | |
4 | +# can be used from Xsession.d | |
5 | +# script needs tee and sed (busybox variants are enough) | |
6 | +# | |
7 | +# original script: Martin Jansa <Martin.Jansa@gmail.com>, 2010-01-31 | |
8 | +# updated by Tias Guns <tias@ulyssis.org>, 2010-02-15 | |
9 | + | |
10 | +BINARY="xinput_calibrator" | |
11 | +CALFILE="/etc/pointercal.xinput" | |
12 | +LOGFILE="/var/log/xinput_calibrator.pointercal.log" | |
13 | + | |
14 | +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)" | |
22 | + fi | |
23 | +fi |