diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2013-06-14 14:38:19 +0300 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2013-07-25 23:44:27 -0700 |
commit | 4ecafd89dbf41cbd53e6db32678fe625c06caaab (patch) | |
tree | e33625fa1955fd485dcd6542000af107976a5907 /meta/recipes-graphics/xinput-calibrator/xinput-calibrator | |
parent | fd2c0af422d67da870a5a11720d06a871e660215 (diff) | |
download | openembedded-core-contrib-4ecafd89dbf41cbd53e6db32678fe625c06caaab.tar.gz |
xinput-calibrator: move it from meta-oe to oe-core
People using xserver-xorg that need to calibrate their touchscreen
devices would also need meta-oe. Bringing the recipes to oe-core will
make it easier for them.
Aditionaly:
* drop xterm RDEPENDS. Terminal is not needed to run the menu item;
* change xinput_calibrator_pointercal.sh so that it can be run as
normal user: pointercal.xinput is saved to ~/.pointercal/ and it will
be used when the system boots;
* have the calibration run through an Xsession file;
* remove the systemd service since calibration is run by Xsession;
* do not install pointercal.xinput if it's the default one;
[YOCTO #4416]
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-graphics/xinput-calibrator/xinput-calibrator')
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh new file mode 100644 index 0000000000..5290726784 --- /dev/null +++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +. /etc/formfactor/config + +if [ "$HAVE_TOUCHSCREEN" = "1" ]; then + /usr/bin/xinput_calibrator_once.sh +fi diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch new file mode 100644 index 0000000000..86982924a8 --- /dev/null +++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch @@ -0,0 +1,66 @@ +Upstream-Status: Pending + +From 14734a93bd3fc323325459e24b04795422e395e6 Mon Sep 17 00:00:00 2001 +From: Laurentiu Palcu <laurentiu.palcu@intel.com> +Date: Mon, 1 Jul 2013 15:38:02 +0300 +Subject: [PATCH] Allow xinput_calibrator_pointercal.sh to be run as normal + user + +Allow normal user to create their own pointercal.xinput files that +override the system pointercal file in /etc. + +Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> +--- + scripts/xinput_calibrator_pointercal.sh | 33 +++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh +index fccb197..0ada7da 100755 +--- a/scripts/xinput_calibrator_pointercal.sh ++++ b/scripts/xinput_calibrator_pointercal.sh +@@ -11,19 +11,32 @@ + PATH="/usr/bin:$PATH" + + BINARY="xinput_calibrator" +-CALFILE="/etc/pointercal.xinput" +-LOGFILE="/var/log/xinput_calibrator.pointercal.log" ++SYS_CALFILE="/etc/pointercal.xinput" ++USER_CALFILE="$HOME/.pointercal/pointercal.xinput" + +-if [ -e $CALFILE ] ; then +- if grep replace $CALFILE ; then +- echo "Empty calibration file found, removing it" +- rm $CALFILE +- else +- echo "Using calibration data stored in $CALFILE" +- . $CALFILE && exit 0 +- fi ++if [ "$USER" = "root" ]; then ++ LOGFILE="/var/log/xinput_calibrator.pointercal.log" ++ CALFILES="$SYS_CALFILE" ++else ++ LOGFILE="$HOME/.pointercal/xinput_calibrator.pointercal.log" ++ CALFILES="$USER_CALFILE $SYS_CALFILE" ++ mkdir -p "$HOME/.pointercal" + fi + ++for CALFILE in $CALFILES; do ++ if [ -e $CALFILE ]; then ++ if grep replace $CALFILE ; then ++ echo "Empty calibration file found, removing it" ++ rm $CALFILE 2>/dev/null || true ++ else ++ echo "Using calibration data stored in $CALFILE" ++ . $CALFILE && exit 0 ++ fi ++ fi ++done ++ ++[ "$USER" != "root" ] && CALFILE=$USER_CALFILE ++ + CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` + if [ ! -z "$CALDATA" ] ; then + echo $CALDATA > $CALFILE +-- +1.7.9.5 + |