From 0849ee91102f00e69260b6de17945378faf1064b Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Thu, 24 Nov 2016 14:05:52 +0200 Subject: openivi-html5.sh: Configure HTML5 application Select HTML5 application that should be loaded on boot (such as a homescreen) through the systemd service of openivi-html5. Following the recommendations of XDG base dir specification, the configuration file should be located at $XDG_CONFIG_DIRS/openivi-html5/openivi-html5.ini and it should contain value for homescreen with path to HTML file. If the configuration file does not exist or if the HTML does not exist then openivi-html5 will load the following sample HTML5 by default: /usr/share/openivi/example/cluster/index.html Bug-AGL: SPEC-332 Change-Id: I496b0ccbcb09f8964042f9d07abad2d552376b80 Signed-off-by: Leon Anavi --- .../openivi-html5/openivi-html5/openivi-html5.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'recipes-openivi/openivi-html5') diff --git a/recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh b/recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh index ed8a56144..190ab653d 100644 --- a/recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh +++ b/recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh @@ -1,9 +1,25 @@ #!/bin/sh +if test -z "$XDG_CONFIG_DIRS"; then + export XDG_CONFIG_DIRS=/etc/xdg/ +fi + if test -z "$XDG_RUNTIME_DIR"; then export XDG_RUNTIME_DIR=/run/user/$UID mkdir --parents $XDG_RUNTIME_DIR chmod 0700 $XDG_RUNTIME_DIR fi -/usr/bin/openivi-html5 -f -u /usr/share/openivi/example/cluster/index.html +# Default homescreen +HOMESCREEN=/usr/share/openivi/example/cluster/index.html + +# Read configuration +HOMESCREEN_CONFIG=$XDG_CONFIG_DIRS/openivi-html5/openivi-html5.ini +if [ -e "$HOMESCREEN_CONFIG" ] ; then + HTML=`sed -n '/^homescreen=\(.*\)$/s//\1/p' < $HOMESCREEN_CONFIG` + if [ -e "$HTML" ] ; then + HOMESCREEN=$HTML + fi +fi + +/usr/bin/openivi-html5 -f -u $HOMESCREEN -- cgit 1.2.3-korg