Last active
August 16, 2024 19:48
-
-
Save Mintedshrimp/af08afc1483403f145b7db7f6a1bc0c5 to your computer and use it in GitHub Desktop.
F*ck yeah I just made an custom proot-distro menu , original script by 23xvx!!! I just made it easier to execute and gave it an GUI using dialog in terminal, execute using bash for best results!!! Enjoy π.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
dialog --clear --title "ββββββββββββββββββββ\nβ Menu β\nββββββββββββββββββββ" \ | |
--menu "Please choose an option:" 15 50 5 \ | |
1 "π§ Install proot-distro" \ | |
2 "π Install Custom Distro" \ | |
3 "π Login" \ | |
4 "ποΈ Remove Existing Distro" \ | |
5 "πͺ Exit" 2>temp_choice.txt | |
choice=$(<temp_choice.txt) | |
case $choice in | |
1) | |
# Check if proot-distro is installed | |
if ! command -v proot-distro &> /dev/null; then | |
printf "ββββββββββββββββββββββ\n" | |
printf "β π§ Installing proot-distro...\n" | |
printf "ββββββββββββββββββββββ\n" | |
pkg update && pkg upgrade | |
pkg install proot-distro | |
printf "βββββββββββββββββββββββββββββββββββ\n" | |
printf "β β proot-distro installation complete. β\n" | |
printf "βββββββββββββββββββββββββββββββββββ\n" | |
else | |
printf "βββββββββββββββββββββββββββββββββββββ\n" | |
printf "β β οΈ proot-distro is already installed. β\n" | |
printf "βββββββββββββββββββββββββββββββββββββ\n" | |
fi | |
# List existing distros | |
printf "ββββββββββββββββββββββββββββ\n" | |
printf "β π Existing Distros: β\n" | |
printf "ββββββββββββββββββββββββββββ\n" | |
proot-distro list | |
# Wait for user to press Enter | |
read -p "Press Enter to continue..." | |
# Prompt for the name of the distro to install | |
dialog --inputbox "π§ Enter the name of the distro you want to install:" 8 40 2>temp_distro_name.txt | |
distro_name=$(<temp_distro_name.txt) | |
if [ -n "$distro_name" ]; then | |
printf "ββββββββββββββββββββββ\n" | |
printf "β π§ Installing %s... β\n" "$distro_name" | |
printf "ββββββββββββββββββββββ\n" | |
proot-distro install "$distro_name" | |
printf "βββββββββββββββββββββββββββββββββββ\n" | |
printf "β β %s installation complete. β\n" "$distro_name" | |
printf "βββββββββββββββββββββββββββββββββββ\n" | |
else | |
printf "βββββββββββββββββββββββββββ\n" | |
printf "β β οΈ No distro name entered. β\n" | |
printf "βββββββββββββββββββββββββββ\n" | |
fi | |
;; | |
2) | |
printf "ββββββββββββββββββββββββββββββββββββββββ\n" | |
printf "β π Downloading and executing custom installer script... β\n" | |
printf "ββββββββββββββββββββββββββββββββββββββββ\n" | |
wget "https://raw.githubusercontent.com/23xvx/Termux-Proot-Custom-Installer/main/wget-proot-distro.sh" -O wget-proot-distro.sh | |
bash wget-proot-distro.sh | |
printf "ββββββββββββββββββββββββββββββββββββββββ\n" | |
printf "β β Custom distro installation complete. β\n" | |
printf "ββββββββββββββββββββββββββββββββββββββββ\n" | |
;; | |
3) | |
dialog --inputbox "π Enter the name of the distro to login:" 8 40 2>temp_distro_name.txt | |
distro_name=$(<temp_distro_name.txt) | |
if [ -n "$distro_name" ]; then | |
printf "βββββββββββββββββββ\n" | |
printf "β π Logging into %s... β\n" "$distro_name" | |
printf "βββββββββββββββββββ\n" | |
proot-distro login "$distro_name" | |
printf "ββββββββββββββββββββββββββ\n" | |
printf "β β Logged into %s. β\n" "$distro_name" | |
printf "ββββββββββββββββββββββββββ\n" | |
else | |
printf "βββββββββββββββββββββββββββ\n" | |
printf "β β οΈ No distro name entered. β\n" | |
printf "βββββββββββββββββββββββββββ\n" | |
fi | |
;; | |
4) | |
dialog --inputbox "ποΈ Enter the name of the distro to remove:" 8 40 2>temp_distro_name.txt | |
distro_name=$(<temp_distro_name.txt) | |
if [ -n "$distro_name" ]; then | |
printf "βββββββββββββββββββ\n" | |
printf "β ποΈ Removing %s... β\n" "$distro_name" | |
printf "βββββββββββββββββββ\n" | |
proot-distro remove "$distro_name" | |
printf "ββββββββββββββββββββββββββ\n" | |
printf "β β %s has been removed. β\n" "$distro_name" | |
printf "ββββββββββββββββββββββββββ\n" | |
else | |
printf "βββββββββββββββββββββββββββ\n" | |
printf "β β οΈ No distro name entered. β\n" | |
printf "βββββββββββββββββββββββββββ\n" | |
fi | |
;; | |
5) | |
printf "βββββββββββββββ\n" | |
printf "β πͺ Exiting... β\n" | |
printf "βββββββββββββββ\n" | |
break | |
;; | |
*) | |
printf "ββββββββββββββββββββββββββββββββββ\n" | |
printf "β β οΈ Invalid choice, please enter a number between 1 and 5. β\n" | |
printf "ββββββββββββββββββββββββββββββββββ\n" | |
;; | |
esac | |
done | |
rm -f temp_choice.txt temp_distro_name.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment