diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2013-06-14 14:38:19 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-29 13:09:00 +0100 |
commit | 0a3d3b606e8991b0e76b3eec110ffc36a3430073 (patch) | |
tree | dc16ac3e4aee54ae14586205e917a38a2e7b5dc2 /meta/recipes-graphics/xinput-calibrator/xinput-calibrator | |
parent | 054b932f7bb8b9c49a5663dfb6f32ae90d4a6046 (diff) | |
download | poky-0a3d3b606e8991b0e76b3eec110ffc36a3430073.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]
(From OE-Core rev: 4ecafd89dbf41cbd53e6db32678fe625c06caaab)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | . /etc/formfactor/config | ||
4 | |||
5 | if [ "$HAVE_TOUCHSCREEN" = "1" ]; then | ||
6 | /usr/bin/xinput_calibrator_once.sh | ||
7 | 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 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | From 14734a93bd3fc323325459e24b04795422e395e6 Mon Sep 17 00:00:00 2001 | ||
4 | From: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
5 | Date: Mon, 1 Jul 2013 15:38:02 +0300 | ||
6 | Subject: [PATCH] Allow xinput_calibrator_pointercal.sh to be run as normal | ||
7 | user | ||
8 | |||
9 | Allow normal user to create their own pointercal.xinput files that | ||
10 | override the system pointercal file in /etc. | ||
11 | |||
12 | Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
13 | --- | ||
14 | scripts/xinput_calibrator_pointercal.sh | 33 +++++++++++++++++++++---------- | ||
15 | 1 file changed, 23 insertions(+), 10 deletions(-) | ||
16 | |||
17 | diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh | ||
18 | index fccb197..0ada7da 100755 | ||
19 | --- a/scripts/xinput_calibrator_pointercal.sh | ||
20 | +++ b/scripts/xinput_calibrator_pointercal.sh | ||
21 | @@ -11,19 +11,32 @@ | ||
22 | PATH="/usr/bin:$PATH" | ||
23 | |||
24 | BINARY="xinput_calibrator" | ||
25 | -CALFILE="/etc/pointercal.xinput" | ||
26 | -LOGFILE="/var/log/xinput_calibrator.pointercal.log" | ||
27 | +SYS_CALFILE="/etc/pointercal.xinput" | ||
28 | +USER_CALFILE="$HOME/.pointercal/pointercal.xinput" | ||
29 | |||
30 | -if [ -e $CALFILE ] ; then | ||
31 | - if grep replace $CALFILE ; then | ||
32 | - echo "Empty calibration file found, removing it" | ||
33 | - rm $CALFILE | ||
34 | - else | ||
35 | - echo "Using calibration data stored in $CALFILE" | ||
36 | - . $CALFILE && exit 0 | ||
37 | - fi | ||
38 | +if [ "$USER" = "root" ]; then | ||
39 | + LOGFILE="/var/log/xinput_calibrator.pointercal.log" | ||
40 | + CALFILES="$SYS_CALFILE" | ||
41 | +else | ||
42 | + LOGFILE="$HOME/.pointercal/xinput_calibrator.pointercal.log" | ||
43 | + CALFILES="$USER_CALFILE $SYS_CALFILE" | ||
44 | + mkdir -p "$HOME/.pointercal" | ||
45 | fi | ||
46 | |||
47 | +for CALFILE in $CALFILES; do | ||
48 | + if [ -e $CALFILE ]; then | ||
49 | + if grep replace $CALFILE ; then | ||
50 | + echo "Empty calibration file found, removing it" | ||
51 | + rm $CALFILE 2>/dev/null || true | ||
52 | + else | ||
53 | + echo "Using calibration data stored in $CALFILE" | ||
54 | + . $CALFILE && exit 0 | ||
55 | + fi | ||
56 | + fi | ||
57 | +done | ||
58 | + | ||
59 | +[ "$USER" != "root" ] && CALFILE=$USER_CALFILE | ||
60 | + | ||
61 | CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'` | ||
62 | if [ ! -z "$CALDATA" ] ; then | ||
63 | echo $CALDATA > $CALFILE | ||
64 | -- | ||
65 | 1.7.9.5 | ||
66 | |||