summaryrefslogtreecommitdiffstats
path: root/meta-agl-ic-container/recipes-demo/momikey/files/momikey.sh
blob: 5672ee9321c5b3997b5689e83a683f1f5d3048d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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_C)
            cmcontrol --force-reboot-guest-role=ivi
            ;;
    esac
done