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

52 lines
1.6 KiB
Plaintext
Raw Normal View History

export HOME=/root
export PATH=$PATH:/etc:~/bin
2024-09-11 14:58:31 +02:00
# source URL data from v86 (file created by v86 during boot)
test -f /mnt/profile.browser && source /mnt/profile.browser
2024-09-11 14:58:31 +02:00
# source xrsh env
source /etc/profile.xrsh
# source shell functions
source /etc/profile.sh
# source js functions
./.profile.js | grep -v undefined
2024-09-11 14:58:31 +02:00
## forward not-found commands to javascript (via jsh)
command_not_found_handle(){
echo "[!] '$1' not found, did you mean $1(...) (javascript?)"
test -n "$ONBOARDING" && echo "[i] type 'help' for handy commands"
test -n "$ONBOARDING" || help
}
help(){
echo ""
echo 'TIPS'
echo '----'
echo 'js run ' "type 'js 'alert(\"hello\")'"
echo 'js console.log: ' "type 'console document.baseURI"
echo 'js function as cmd: ' "type 'alias $1=\"jsh $1\"' to run '$1 yo' as $1('yo')"
echo 'js inspect: ' "type 'js \"return document.baseURI\"'"
echo 'js console mute: ' "type 'echo 0 > /dev/browser/tty' to disable"
2024-09-11 14:58:31 +02:00
echo 'js capture console: ' "type 'tail -f /dev/browser/console'"
echo 'jsh<->sh hooks: ' "type 'chmod +x ~/hook.d/*/* && alert helloworld'"
echo 'include file into page' "type 'require <url.js|css>'"
echo 'create AFRAME a-entity' "type 'a_entity <componentname> [...]"
echo ''
echo 'type "man -l /root/manual.md" to read the full manual"'
ONBOARDING=1
}
export TERM=xterm-256color
export PS1="\n\[\033[38;5;57m\]x\[\033[38;5;93m\]r\[\033[38;5;129m\]s\[\033[38;5;165m\]h \[\033[38;5;201m\]# \[\033[0m\]"
# interactive login
[[ -t 0 ]] && {
cat /etc/motd
test -n "$STY" || {
screen -R -T screen-256color -c /root/.screenrc
}
}