From e95915994d466b600f25d4ac4650cad606dcc827 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Sat, 5 Oct 2024 17:57:16 -0400 Subject: [PATCH 1/2] update yoe-kiosk-browser and add options Signed-off-by: Cliff Brake --- .../kiosk-browser/yoe-kiosk-browser.bb | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb b/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb index 4660ef763..e799c73e3 100644 --- a/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb +++ b/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb @@ -4,7 +4,7 @@ LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9" SRC_URI = "git://github.com/YoeDistro/yoe-kiosk-browser;branch=main;protocol=https" -SRCREV = "738469237165cf991a24541e18ce99909b3806d4" +SRCREV = "47846c7a62aea8317070f4a79b80cd26ded74bdd" PV = "1.0.0+git" @@ -23,19 +23,41 @@ INITSCRIPT_PARAMS = "start 99 5 . stop 20 6 ." # You can override the following settings in site.conf, etc. # Default to Simple IoT. YOE_KIOSK_BROWSER_URL ?= "http://localhost:8118" + # Currently, values of 0, 90, and 270 are supported YOE_KIOSK_BROWSER_ROTATE ?= "0" + # the following scale should be <= 1 YOE_KIOSK_BROWSER_KEYBOARD_SCALE ?= "1" + +# start full screen +YOE_KIOSK_BROWSER_FULLSCREEN ?= "1" + +# If you have no trouble with default dialogs, enable them here +YOE_KIOSK_BROWSER_DEFAULT_DIALOGS ?= "0" +YOE_KIOSK_BROWSER_DIALOG_COLOR ?= "#D91824" + +# On some touchscreens the first input of a touch event wont activate the +# correct focus. This quirk solves this issue. +YOE_KIOSK_BROWSER_TOUCH_QUIRK ?= "1" + # the following is the interval at which we try # to reload a failed web page (seconds) # default is 5s if not specified. YOE_KIOSK_BROWSER_RETRY_INTERVAL = "10" + # the following is typically a local web page that is loaded # instead of the default error screen. # If this is not set, the default error screen is shown. YOE_KIOSK_BROWSER_EXCEPTION_URL="" +# In case you use your own trusted https webserver on your local browser +# you can ignore the certification errors. +YOE_KIOSK_BROWSER_IGNORE_CERT_ERR ?= "1" + +# Running the browser in root will require disabled sandbox mode +QTWEBENGINE_DISABLE_SANDBOX ?= "1" + # Depending upon screen attached to system SCREEN_RESOLUTION ?= "1024x600" @@ -60,9 +82,30 @@ do_install:append() { sed -i "s|@KEYBOARD_SCALE@|${YOE_KIOSK_BROWSER_KEYBOARD_SCALE}|" \ ${D}${sysconfdir}/default/yoe-kiosk-browser + sed -i "s|@FULLSCREEN@|${YOE_KIOSK_BROWSER_FULLSCREEN}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + + sed -i "s|@DEFAULT_DIALOGS@|${YOE_KIOSK_BROWSER_DEFAULT_DIALOGS}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + + sed -i "s|@DIALOG_COLOR@|${YOE_KIOSK_BROWSER_DIALOG_COLOR}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + + sed -i "s|@TOUCH_QUIRK@|${YOE_KIOSK_BROWSER_TOUCH_QUIRK}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + sed -i "s|@RETRY_INTERVAL@|${YOE_KIOSK_BROWSER_RETRY_INTERVAL}|" \ ${D}${sysconfdir}/default/yoe-kiosk-browser + sed -i "s|@EXCEPTION_URL@|${YOE_KIOSK_BROWSER_EXCEPTION_URL}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + + sed -i "s|@IGNORE_CERT_ERR@|${YOE_KIOSK_BROWSER_IGNORE_CERT_ERR}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + + sed -i "s|@DISABLE_SANDBOX@|${QTWEBENGINE_DISABLE_SANDBOX}|" \ + ${D}${sysconfdir}/default/yoe-kiosk-browser + sed -i "s|@@|${YOE_KIOSK_BROWSER_KEYBOARD_SCALE}|" \ ${D}${sysconfdir}/default/yoe-kiosk-browser @@ -72,6 +115,11 @@ do_install:append() { sed -i "s|@DISPLAY_CARD@|${DISPLAY_CARD}|" \ ${D}${sysconfdir}/default/eglfs.json + if [ "${YOE_KIOSK_BROWSER_XCB}" = "1" ]; then + echo "DISPLAY=:0" >> ${D}${sysconfdir}/default/yoe-kiosk-browser + echo "XAUTHORITY=/home/root/.Xauthority" >> ${D}${sysconfdir}/default/yoe-kiosk-browser + echo "QT_QPA_PLATFORM=xcb" >> ${D}${sysconfdir}/default/yoe-kiosk-browser + fi } SYSTEMD_SERVICE:${PN} = "yoe-kiosk-browser.service" From ddaa8c25395637697cd49c744fc703e8c1eeecae Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Sat, 5 Oct 2024 18:02:38 -0400 Subject: [PATCH 2/2] add XCB variable --- .../qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb b/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb index e799c73e3..0e6de25c7 100644 --- a/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb +++ b/sources/meta-yoe/dynamic-layers/qt6-layer/recipes-qt/kiosk-browser/yoe-kiosk-browser.bb @@ -66,6 +66,8 @@ DISPLAY_CARD ?= "/dev/dri/card0" # Define it via a knob which can be set from config file e.g. local.conf YOE_KIOSK_BROWSER_SYSTEMD_UNIT ?= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'yoe-kiosk-browser-wayland.service', 'yoe-kiosk-browser-eglfs.service', d)}" +YOE_KIOSK_BROWSER_XCB = "1" + do_install:append() { echo "Browser URL: ${YOE_KIOSK_BROWSER_URL}" install -D -m 0644 ${S}/${YOE_KIOSK_BROWSER_SYSTEMD_UNIT} ${D}${systemd_unitdir}/system/yoe-kiosk-browser.service