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 <leon.anavi@konsulko.com>
+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
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