summaryrefslogtreecommitdiffstats
path: root/meta-agl-ic-container/recipes-demo/momikey/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-ic-container/recipes-demo/momikey/files')
-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
3 files changed, 38 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