From 2ba3cc185a6b8bf7d97433afd50789103385ba7f Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Fri, 30 Aug 2024 11:09:37 +0000 Subject: [PATCH] source /mnt/profile.js on boot + bugfix cmd fragment --- com/isoterminal.js | 4 ++-- com/isoterminal/mnt/profile | 5 +---- com/isoterminal/mnt/profile.xrsh | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/com/isoterminal.js b/com/isoterminal.js index b1380dd..71f900e 100644 --- a/com/isoterminal.js +++ b/com/isoterminal.js @@ -283,10 +283,10 @@ AFRAME.registerComponent('isoterminal', { env.push( 'export '+String(i).toUpperCase()+'="'+document.location[i]+'"') } env.map( (e) => emulator.serial0_send(`echo '${e}' >> /mnt/profile\n`) ) - let boot = `source /mnt/profile` + let boot = `source /mnt/profile; js "$(cat /mnt/profile.js)"` // exec hash as extra boot cmd if( document.location.hash.length > 1 ){ - boot += `&& cmd='${decodeURI(document.location.hash.substr(1))}' && $cmd` + boot += ` && cmd='${decodeURI(document.location.hash.substr(1))}' && $cmd` } emulator.serial0_send(boot+"\n") instance.winbox.maximize() diff --git a/com/isoterminal/mnt/profile b/com/isoterminal/mnt/profile index 5169429..2305535 100644 --- a/com/isoterminal/mnt/profile +++ b/com/isoterminal/mnt/profile @@ -1,9 +1,6 @@ # source xrsh env source /mnt/profile.xrsh -# source javascript functions -js "$(cat /mnt/profile.js)" - ## forward not-found commands to javascript (via jsh) command_not_found_handle(){ echo "$1 not found, did you mean $1(...) (javascript?)" @@ -16,7 +13,7 @@ command_not_found_handle(){ } resize -#clear +test $HOSTNAME = localhost || clear cat /mnt/motd export PATH=$PATH:/mnt export PS1="\nxrsh # \033[0m" diff --git a/com/isoterminal/mnt/profile.xrsh b/com/isoterminal/mnt/profile.xrsh index 683d9c5..3729b68 100644 --- a/com/isoterminal/mnt/profile.xrsh +++ b/com/isoterminal/mnt/profile.xrsh @@ -43,5 +43,6 @@ test -d /dev/browser || { setup_binaries setup_browser_dev setup_hook_dirs + }