forked from tias/xinput_calibrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch xinput_calibrator_pointercal.sh to use xorg.conf.d mode
[CM-4485] Closes: tias#75 Signed-off-by: Al Nikolov <[email protected]>
- Loading branch information
Al Nikolov
committed
May 18, 2020
1 parent
03dadf5
commit dc2396f
Showing
1 changed file
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,25 +7,22 @@ | |
# original script: Martin Jansa <[email protected]>, 2010-01-31 | ||
# updated by Tias Guns <[email protected]>, 2010-02-15 | ||
# updated by Koen Kooi <[email protected]>, 2012-02-28 | ||
# updated by Al Nikolov <[email protected]>, 2020-05-14 | ||
|
||
PATH="/usr/bin:$PATH" | ||
|
||
BINARY="xinput_calibrator" | ||
CALFILE="/etc/pointercal.xinput" | ||
CALFILE="/etc/X11/xorg.conf.d/99-calibration.conf" | ||
LOGFILE="/var/log/xinput_calibrator.pointercal.log" | ||
|
||
if [ -e $CALFILE ] ; then | ||
if grep replace $CALFILE ; then | ||
echo "Empty calibration file found, removing it" | ||
rm $CALFILE | ||
echo "Empty calibration file found" | ||
else | ||
echo "Using calibration data stored in $CALFILE" | ||
. $CALFILE && exit 0 | ||
exit 0 | ||
fi | ||
fi | ||
|
||
CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` | ||
if [ ! -z "$CALDATA" ] ; then | ||
echo $CALDATA > $CALFILE | ||
echo "Calibration data stored in $CALFILE (log in $LOGFILE)" | ||
fi | ||
$BINARY --output-type xorg.conf.d -v --output-filename $CALFILE | tee $LOGFILE | ||
echo "Calibration data stored in $CALFILE (log in $LOGFILE)" |