summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2018-01-25 19:03:33 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-03-22 09:20:00 +0100
commit3827a5d1b8803b2d0c8f19c5f59365992eb123bb (patch)
tree563f699f8f3e7dff25c1d498eca7f8816ceeac1a
parentd81c71fbb99c95a50d2ebc73da2fa8ae665a8b35 (diff)
x-window-simple-app: start a x11 application
After the xserver-nodm-init started the Xserver this provides a script to start exactly one X application. Change the variables INITIAL_PATH and X_APPLICATION to the specify the current working directory when starting the application and the path to the application which is to be started. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--recipes-graphics/x-window-simple-app/x-window-simple-app/set_have_touch.sh2
-rw-r--r--recipes-graphics/x-window-simple-app/x-window-simple-app/x-window-manager.in6
-rw-r--r--recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb37
3 files changed, 45 insertions, 0 deletions
diff --git a/recipes-graphics/x-window-simple-app/x-window-simple-app/set_have_touch.sh b/recipes-graphics/x-window-simple-app/x-window-simple-app/set_have_touch.sh
new file mode 100644
index 0000000..d4d49d5
--- /dev/null
+++ b/recipes-graphics/x-window-simple-app/x-window-simple-app/set_have_touch.sh
@@ -0,0 +1,2 @@
+# force have touchscreen
+HAVE_TOUCHSCREEN=1
diff --git a/recipes-graphics/x-window-simple-app/x-window-simple-app/x-window-manager.in b/recipes-graphics/x-window-simple-app/x-window-simple-app/x-window-manager.in
new file mode 100644
index 0000000..b3e0e8f
--- /dev/null
+++ b/recipes-graphics/x-window-simple-app/x-window-simple-app/x-window-manager.in
@@ -0,0 +1,6 @@
+RET=1
+while [ $RET -ne 0 ]; do
+ cd @PATH@
+ @APP@
+ RET=$?
+done
diff --git a/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb b/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb
new file mode 100644
index 0000000..cb3ccd2
--- /dev/null
+++ b/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb
@@ -0,0 +1,37 @@
+SECTION = "x11/libs"
+SUMMARY = "x11 application autostart"
+DESCRIPTION = \
+"This installs a /usr/bin/x-window-manager script. The script will start the \
+one and only application X_APPLICATION as the last step of the \
+xserver-nodm-init X initialization. \
+If the script ever returns, X will be killed."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit allarch
+
+S = "${WORKDIR}"
+
+INITIAL_PATH ?= "/usr/share/qtsmarthome-1.0"
+X_APPLICATION ?= "${INITIAL_PATH}/smarthome"
+
+SRC_URI = " \
+ file://x-window-manager.in \
+ file://set_have_touch.sh \
+"
+
+do_compile () {
+ sed -e "s:@PATH@:${INITIAL_PATH}:" -e "s:@APP@:${X_APPLICATION}:" x-window-manager.in > x-window-manager
+}
+
+do_install () {
+ install -d ${D}/${bindir} ${D}${sysconfdir}/X11/Xsession.d
+ install -m 0755 ${S}/x-window-manager ${D}/${bindir}
+ install -m 0644 ${S}/set_have_touch.sh ${D}/${sysconfdir}/X11/Xsession.d/29set_have_touch.sh
+}
+
+# make sure xinput_calibrator is only started once
+pkg_postinst_${PN}() {
+ rm /etc/xdg/autostart/xinput_calibrator.desktop
+}