summaryrefslogtreecommitdiff
path: root/recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2022-09-06 13:56:46 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2022-09-26 13:45:02 +0000
commita89c5d34160fd16bfbc434b231200636cd0782b0 (patch)
tree44b2d9283a67b616829f17d9864b9a3b6d7c34a8 /recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh
parent0f90271d9148a6413d665cf4a83c168c3059cecb (diff)
weston-init: support weston touch calibration
Add a new PACKAGECONFIG touchscreen-calibration, when it's enabled, add the following fields in weston.ini: ``` [libinput] enable_tap=true touchscreen_calibrator=true calibration_helper=/usr/bin/toradex-save-touchscreen-calibration ``` When weston-touch-calibrator is called by an end user, /usr/bin/toradex-save-touchscreen-calibration will be triggered to create a udev rule to export LIBINPUT_CALIBRATION_MATRIX then trigger that udev rule. The end users need to restart weston to let the new calibration matrix to take effect. Related-to: ELB-4570 Signed-off-by: Ming Liu <ming.liu@toradex.com>
Diffstat (limited to 'recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh')
-rwxr-xr-xrecipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh b/recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh
new file mode 100755
index 0000000..e2871fc
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/toradex-save-touchscreen-calibration.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$#" -ne 7 ]; then
+ echo "This script is to be called by weston with new touch calibration data, it requires 7 parameters."
+ exit 1
+fi
+
+echo 'ACTION=="add|change", SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}=''"'"$2 $3 $4 $5 $6 $7"'"' > /etc/udev/rules.d/libinput.rules
+
+# Make udev process the new rule by triggering a "change" event:
+udevadm trigger "$1"