2 # script to make the changes permanent (xinput is called with every Xorg start)
4 # can be used from Xsession.d
5 # script needs tee and sed (busybox variants are enough)
7 # original script: Martin Jansa <Martin.Jansa@gmail.com>, 2010-01-31
8 # updated by Tias Guns <tias@ulyssis.org>, 2010-02-15
9 # updated by Koen Kooi <koen@dominion.thruhere.net>, 2012-02-28
13 BINARY="xinput_calibrator"
14 CALFILE="/etc/pointercal.xinput"
15 LOGFILE="/var/log/xinput_calibrator.pointercal.log"
17 if [ -e $CALFILE ] ; then
18 if grep replace $CALFILE ; then
19 echo "Empty calibration file found, removing it"
22 echo "Using calibration data stored in $CALFILE"
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)"