xrforge/manyfold/root/hook.d/inotify_MODIFY/package_janusxr.sh

33 lines
671 B
Bash
Raw Normal View History

2025-10-24 18:42:55 +02:00
#!/bin/sh
echo "$1" | grep datapackage || exit 0 # nothing to do
dir=$(dirname $1)
cd "$dir"
echo "[package_janusxr.sh] packing janusxr.html"
glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match
jml='
<html>
<head>
<title>janusxr room</title>
</head>
<body>
<script src="https://web.janusvr.com/janusweb.js"></script>
<janus-viewer>
<FireBoxRoom>
<Assets>
<AssetObject id="experience" src="'$glb'" ></AssetObject>
</Assets>
<Room>
<Object id="experience" locked="true" pos="0 0 0"></Object>
</Room>
</FireBoxRoom>
</janus-viewer>
</body>
</html>
'
echo "$jml" > janusxr.html