From: Randolph Sapp <[email protected]>

The old touchscreen calibration script created a generic UDEV rule for
all touch devices that applied the LIBINPUT_CALIBRATION_MATRIX of the
last calibrated display. This attempts to replace that to an extent.

This script executes at the start of Weston and if it detects a touch
input device, uses Weston's built in touchscreen calibrator and
touchscreen calibrator interface to apply the current calibration
without restarting Weston. This script does not attempt to make these
calibration values persistent.

If a user wants calibration values to persist for all Weston users they
should add the calibration to /etc/default/weston using the
LIBINPUT_CALIBRATION_MATRIX variable themselves. The script will bypass
calibration if it detects this variable is already set.

Signed-off-by: Randolph Sapp <[email protected]>
---
 .../recipes-graphics/wayland/weston-init.bbappend   | 13 ++++++++++---
 .../wayland/weston-init/weston-launch-calibrator.sh | 13 +++++++++++++
 .../recipes-graphics/wayland/weston-init/weston.ini |  4 ++++
 3 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 
meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh

diff --git a/meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend 
b/meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend
index a73b669d..4d5db58c 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend
+++ b/meta-arago-distro/recipes-graphics/wayland/weston-init.bbappend
@@ -2,6 +2,13 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
 PR:append = ".arago12"
 
-#SRC_URI:append = " \
-#    file://weston.ini \
-#"
+SRC_URI:append = " \
+    file://weston.ini \
+    file://weston-launch-calibrator.sh \
+"
+
+do_install:append() {
+    install -Dm755 weston-launch-calibrator.sh 
${D}/${bindir}/weston-launch-calibrator
+}
+
+FILES:${PN}:append = "${bindir}/weston-launch-calibrator"
diff --git 
a/meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh
 
b/meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh
new file mode 100644
index 00000000..45863ecd
--- /dev/null
+++ 
b/meta-arago-distro/recipes-graphics/wayland/weston-init/weston-launch-calibrator.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -e /dev/input/touchscreen0 ]; then
+       echo "Touch screen detected..."
+       if [ -n "$LIBINPUT_CALIBRATION_MATRIX" ]; then
+               echo "Calibration matrix already present, skipping 
calibration..."
+       else
+               echo "Calibrating touchscreen..."
+               exec weston-calibrator
+       fi
+else
+       echo "Touch screen not detected, skipping calibration..."
+fi
diff --git a/meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini 
b/meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini
index 4cc2683a..b9610fa8 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini
+++ b/meta-arago-distro/recipes-graphics/wayland/weston-init/weston.ini
@@ -11,6 +11,10 @@ startup-animation=fade
 [libinput]
 touchscreen_calibrator=true
 
+[autolaunch]
+# launch the calibrator on startup if a touchscreen is detected
+path=/usr/bin/weston-launch-calibrator
+
 [screensaver]
 # Uncomment path to disable screensaver
 #path=@libexecdir@/weston-screensaver
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14463): 
https://lists.yoctoproject.org/g/meta-arago/message/14463
Mute This Topic: https://lists.yoctoproject.org/mt/99114613/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to