xrsh-buildroot/buildroot-v86/board/v86/rootfs_overlay/etc/profile.js

18 lines
526 B
JavaScript
Raw Normal View History

2024-09-11 14:58:31 +02:00
#!/bin/js
2024-09-15 11:18:36 +02:00
// do once (remember /etc/profile gets sources multiple times!)
if( !window['/etc/profile.js'] ){
2024-10-23 18:51:56 +02:00
const isoterminal = document.querySelector('[isoterminal]').components.isoterminal.term
2024-09-15 11:18:36 +02:00
const scene = document.querySelector('a-scene')
// map AFRAME events to ~/hook.d/{event}/* triggers
events = ['enter-ar','enter-vr','exit-vr','exit-ar']
events.map( (event) => {
scene.addEventListener( event, (e) => isoterminal.exec("hook "+event) )
})
window['/etc/profile.js'] = true
2024-09-11 14:58:31 +02:00
}