made hooks aliases to ~/bin

This commit is contained in:
Leon van Kammen 2024-11-19 16:17:06 +01:00
parent 919a888386
commit 9af957b6d5
8 changed files with 28 additions and 14 deletions

View File

@ -0,0 +1,6 @@
#!/bin/sh
test -n "$1" || { echo "usage: a-gltf-model <gltf-file>"; exit; }
file="${1#/}" # strip leading slash if present
echo "<a-gltf-model src='file://xrsh/$file'></a-gltf-model>" >> /root/index.html

View File

@ -0,0 +1,7 @@
#!/bin/sh
test -n "$1" || { echo "usage: a-text <textfile_or_string>"; exit; }
str="$1"
test -f "$str" && str="$(cat "$1" | sed ':a;N;$!ba;s/\n/\\n/g' )" # escape linebreaks
echo "<a-text value='${str}' position='-0.4 1.8 -3' grabbable></a-text>" >> /root/index.html

View File

@ -0,0 +1 @@
../../../bin/a-text

View File

@ -1,6 +0,0 @@
#!/bin/sh
# usage: import-to-aframe <textfile>
str="$(cat "$1" | sed ':a;N;$!ba;s/\n/\\n/g' )" # escape linebreaks
echo "<a-text value='${str}' position='-0.4 1.8 -3' grabbable></a-text>" >> /root/index.html

View File

@ -0,0 +1 @@
../../../../bin/a-gltf-model

View File

@ -1,6 +0,0 @@
#!/bin/sh
# usage: import-to-aframe <textfile>
str="$(cat "$1" | sed ':a;N;$!ba;s/\n/\\n/g' )" # escape linebreaks
echo "<a-text value='${str}' position='-0.4 1.8 -3' grabbable></a-text>" >> /root/index.html

View File

@ -1,2 +0,0 @@
#!/bin/sh
logger "*TODO*: importing to scene"

View File

@ -168,3 +168,16 @@ ctrl a X -> remove active win­dow from split screen
ctrl a O -> logout active win­dow (dis­able out­put)
ctrl a I -> login active win­dow (enable output)
```
## webrequests to the filesystem
Javascript webrequests can read from the filesystem via the 'file://host/path' protocol:
```
fetch("file://xrsh/mnt/profile.browser")
```
current [security] limitations:
* only /mnt directory is exposed
* file needs to be world-readable (`chmod +r /mnt/<file>`)