summaryrefslogtreecommitdiffstats
path: root/meta-agl-ic-container/recipes-demo
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-ic-container/recipes-demo')
-rw-r--r--meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules1
-rw-r--r--meta-agl-ic-container/recipes-demo/momikey/files/momikey.service10
-rw-r--r--meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh27
-rw-r--r--meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb39
4 files changed, 77 insertions, 0 deletions
diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules
new file mode 100644
index 00000000..167a5cb1
--- /dev/null
+++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="usb", ATTR{idVendor}=="1189", ATTR{idProduct}=="8890", RUN+="/bin/sh -c 'systemctl start momikey'"
diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service
new file mode 100644
index 00000000..e2e50efb
--- /dev/null
+++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=CH57x keyboard based UI for container demo
+After=container-manager.service multi-user.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/momikey.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh
new file mode 100644
index 00000000..d0e0b0b6
--- /dev/null
+++ b/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+while sleep 1 ;do evtest /dev/input/by-id/usb-wch.cn_CH57x-event-kbd ;done | while read line; do
+ unset key target_container
+ [[ "$line" =~ \((KEY_.)\),\ value\ 1 ]] && key="${BASH_REMATCH[1]}"
+ case "$key" in
+ KEY_G)
+ cmcontrol --change-active-guest-name=agl-flutter-ivi-demo
+ cmcontrol --shutdown-guest-role=ivi
+ ;;
+ KEY_D)
+ cmcontrol --change-active-guest-name=agl-qt-ivi-demo
+ cmcontrol --shutdown-guest-role=ivi
+ ;;
+ KEY_A)
+ cmcontrol --change-active-guest-name=agl-momi-ivi-demo
+ cmcontrol --shutdown-guest-role=ivi
+ ;;
+ KEY_H)
+ cmcontrol --change-active-guest-name=agl-html5-ivi-demo
+ cmcontrol --shutdown-guest-role=ivi
+ ;;
+ KEY_C)
+ cmcontrol --force-reboot-guest-role=ivi
+ ;;
+ esac
+done
diff --git a/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb b/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb
new file mode 100644
index 00000000..845ef46d
--- /dev/null
+++ b/meta-agl-ic-container/recipes-demo/momikey/momikey_0.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "CH57x keyboard based UI for container demo"
+DESCRIPTION = "Container exchange user interface using CH57x keyboard. \
+ This UI based on mock container manager for AGL CES2023 demo."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI += " \
+ file://momikey.sh \
+ file://momikey.service \
+ file://momikey.rules \
+"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE:${PN} = "momikey.service"
+SYSTEMD_AUTO_ENABLE:${PN} = "disable"
+
+do_install:append () {
+ install -d ${D}/usr/bin
+ install -m 0755 ${WORKDIR}/momikey.sh ${D}/usr/bin/momikey.sh
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/momikey.service ${D}${systemd_system_unitdir}
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 644 ${WORKDIR}/momikey.rules ${D}${sysconfdir}/udev/rules.d/
+}
+
+FILES:${PN} += " \
+ /usr/bin/momikey.sh \
+ ${systemd_system_unitdir} \
+ ${sysconfdir}/udev/rules.d/ \
+"
+
+RDEPENDS:${PN} := " \
+ bash \
+ evtest \
+"