xrforge/manyfold/root/hook.d/experience_updated/300-package_janusxr.sh

31 lines
646 B
Bash
Raw Normal View History

2025-10-24 18:42:55 +02:00
#!/bin/sh
dir="$(dirname $1)"
2025-10-24 18:42:55 +02:00
cd "$dir"
echo "[package_janusxr.sh] packing janusxr.html"
glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match
jml='
2025-10-30 09:13:46 +01:00
<!DOCTYPE html>
2025-10-24 18:42:55 +02:00
<html>
<head>
<title>janusxr room</title>
</head>
<body>
<script src="https://web.janusvr.com/janusweb.js"></script>
<janus-viewer>
<FireBoxRoom>
2025-10-30 09:13:46 +01:00
<Assets>
<assetobject id="experience" src="'${FEDERATE_DRIVE_HOST}/$1'"/>
</Assets>
<Room>
<object pos="0 0 0" collision_id="experience" id="experience" />
</Room>
2025-10-24 18:42:55 +02:00
</FireBoxRoom>
</janus-viewer>
</body>
</html>
'
2025-10-30 09:13:46 +01:00
echo "$jml" > .xrforge/janusxr.html