The backend for a Bash terminal in Scratch!
Known issues:
- Running an interative command softlocks the system (e.g.
sudo <command>
)
- Start by remixing the scratch2bash project!
Now open your terminal in your favourite environment (this could work with Windows, but I haven't really tested nor been interested in it haha)
- Install the requirements
If you want this to run in the background, install screen too.
sudo apt update && sudo apt upgrade sudo apt install python3
sudo apt install screen
- Copy and paste the following:
cd ~ mkdir bash2scratch cd bash2scratch curl -o main.py https://raw.githubusercontent.com/Fox595676/bash2scratch/refs/heads/main/main.py echo "Enter your session ID (this can be found by opening developer tools on Scratch etc, https://github.com/TimMcCool/scratchattach/wiki/Get-your-session-id):" read id echo "Enter your username:" read username echo "Enter your project ID (the numbers at the end of your remixed project):" read project_id sed -i "s/id = \"ID_HERE\"/id = \"$id\"/" main.py sed -i "s/user = \"Username\"/user = \"$username\"/" main.py sed -i "s/project = \"projectid\"/project = \"$project_id\"/" main.py python -m venv . source bin/activate python -m pip install -U scratchattach
- Start the script
~/bash2scratch/bin/python3 ~/bash2scratch/main.py
- If you want to have this running in the background, paste the following, and press Ctrl + A, then Ctrl + D to exit.
screen -S bash2scratch bash -c "~/bash2scratch/bin/python3 ~/bash2scratch/main.py"
- If you want to reconnect, type
screen -r bash2scratch