39f3781bbca5c6e5f81f3a0fa3325f042fff929e
[AGL/meta-agl-demo.git] / recipes-graphics / web-runtime / web-runtime / web-runtime
1 #!/bin/bash
2 export -n QT_WAYLAND_SHELL_INTEGRATION
3 port=$(echo -n "$1" | sed 's,.*local.*:\([^/]*\)/.*,\1,')
4 token=$(echo -n "$1" | sed 's,.*token=,,')
5 export AFM_APP_INSTALL_DIR=$(mktemp -d)
6 cat << EOC >  $AFM_APP_INSTALL_DIR/runxdg.toml
7 [application]
8 role = "WebBrowser"
9 method = "POSIX"
10 path = "/usr/bin/qt5/qmlscene"
11 params = [
12      "$1",
13      "/usr/bin/web-runtime.qml"
14 ]
15 EOC
16 export LD_PRELOAD=/usr/lib/libEGL.so
17 /usr/bin/runxdg "$port" "$token"
18 rm -rf $AFM_APP_INSTALL_DIR