Skip to content

Instantly share code, notes, and snippets.

@Mintedshrimp
Last active August 16, 2024 19:48
Show Gist options
  • Save Mintedshrimp/af08afc1483403f145b7db7f6a1bc0c5 to your computer and use it in GitHub Desktop.
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 😊.
#!/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