File size: 1,620 Bytes
4408617 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
#!/bin/bash
# Setup script for X11 Desktop on Termux
# This script helps install dependencies and launch the environment.
set -e
echo "X11 Desktop - Termux Setup Helper"
echo "================================="
# Check if running in Termux
if [ -z "$TERMUX_VERSION" ]; then
echo "Error: This script is intended to run inside Termux on Android."
exit 1
fi
setup_dependencies() {
echo "Updating packages..."
pkg update -y
echo "Installing X11 repo..."
pkg install -y x11-repo
echo "Installing dependencies (proot-distro, termux-x11-nightly)..."
pkg install -y proot-distro termux-x11-nightly pulseaudio
echo "Dependencies installed."
}
install_debian() {
if proot-distro list | grep -q "debian (installed)"; then
echo "Debian is already installed."
else
echo "Installing Debian..."
proot-distro install debian
fi
}
launch_session() {
echo "Instructions to launch:"
echo "1. Open the Termux:X11 app."
echo "2. Run the following command to login and start XFCE:"
echo ""
echo " proot-distro login --user user debian --shared-tmp -- bash -c 'export DISPLAY=:0; dbus-launch --exit-with-session xfce4-session'"
echo ""
}
echo "Select an option:"
echo "1) Install Dependencies"
echo "2) Install Debian (Proot)"
echo "3) Show Launch Instructions"
echo "4) Exit"
read -p "Choice: " choice
case $choice in
1)
setup_dependencies
;;
2)
install_debian
;;
3)
launch_session
;;
4)
exit 0
;;
*)
echo "Invalid choice."
;;
esac
|