Skip to content

Termux setup and utility scripts for development tools, proot, QEMU, box86, and more.

License

Notifications You must be signed in to change notification settings

Willie169/termux-sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

termux-sh

This repository contains Shell scripts for Termux, a terminal emulator for Android. These scripts include setup automation, shortcuts, installations and configurations of development tools and emulation environments such as proot, proot-distro, QEMU system emulation, and box64, and more.

My tutorials for Termux, some of my scripts in this repository, and other related stuff such as VNC, SSL, and SSH, are in Android-Non-Root, which also includes tutorials for a range of powerful, open-source tools such as F-Droid, Shizuku, Tor, TrackerControl, InviZible Pro, and PipePipe to enhance Android device’s functionality, security, privacy, and customization without the need for root access.


Termux Setup (termux-setup.sh)

Prerequisites

  • Approximately 18.5GB of storage space for default configuration. Approximately 30.1GB of storage space if none of UBUNTU, DEBIANBOX, BUSTERCLI, and BUSTERXFCE is empty string, and none of DEBIANINSTALL, UBUNTUINSTALL, DEBIANBOXINSTALL, and BUSTERCLIINSTALL is 0.
  • Internet connection for packages and scripts download.
  • It is recommended to turn off the battery optimization for Termux.
  • It is recommended to hold wakelock while running these scripts. You can do so by opening Termux, pulling down the notification bar, and then tapping Acquire wakelock on the notification of Termux.
  • It is recommended to prevent the Process completed (signal 9) - press Enter error in advance. You may encounter it when using Termux, especially when running VMs. To prevent it from occuring, please read my tutorial Android Non Root about it: https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for the fixes.

Execution

  1. In termux-change-repo, it is recommended to choose a mirror close to your geographic location:
termux-setup-storage
termux-change-repo
pkg update && pkg install git -y
cd ~ && git clone https://github.com/Willie169/termux-sh.git
  1. Optionally edit the variables in the beginning of ~/termux-sh/termux-setup.sh (nano for example). In VM names variables, (space) will be replaced with _, names that are not allowed will be added a suffix 1:
pkg install nano
nano ~/termux-sh/termux-setup.sh
  1. Run the setup script:
bash ~/termux-sh/termux-setup.sh

termux-setup.sh will install essential packages, configures shortcuts, and sets up VMs in Termux.

Follow the screen guide to complete it. If you see a dancing parrot on screen, which is powered by parrot.live, pull down the notification bar and tap exit on the notification of Termux. Now, you can restart Termux and enjoy it.

Features

The variables below refer to the variables set in the beginning of termux-setup.sh.

  1. Termux packages installation: Installs Termux packages set in $PKG. The default includes tools for development, runtime environments, and utilities for C/C++, Python, Java, Node.js, Rust, Go, Ruby, Perl, proot, GitHub, GitLab, SSL, SSH, JQ, FFMPEG, Maven, Termux-X11, TigerVNC, XFCE4, Zsh, and more on Termux.
  2. Shortcut configuration: Copies shortcuts from DOTshortcuts into .shortcuts for Termux:Widget and the home directory (~) and renames the bashrc.sh in the home directory to .bashrc.
  3. Termux properties adjustments: Enables external app access in termux.properties.
  4. Termux proot environment: Installs Yonle's termux-proot, a Termux proot environment, with proot-termux.sh, if not PROOTTERMUX=0.
  5. Audio setup: Configures audio output using Andronix's setup-audio.sh if not AUDIO=0.
  6. Node.js packages installation: Installs NPM packages set in $NPM. The default is jsdom marked marked-gfm-heading-id node-html-markdown showdown.
  7. Go package installation: Installs Go packages set in $GO. The default is fabric, an open-source modular framework for augmenting humans using Al using a crowdsourced set of Al prompts.
  8. Proot-distro Debian Bookworm environment with development tools: Configures Debian Bookworm ARM64 proot-distro instance with alias $DEBIAN if $DEBIAN is not empty string, and install development tools in it if $DEBIAN is not empty string and $DEBIANINSTALL is not 0.
  9. Proot-distro Ubuntu environment with development tools: Configures an Ubuntu 24.04 ARM64 proot-distro instance with alias $UBUNTU if $UBUNTU is not empty string, and install development tools in it if $UBUNTU is not empty string and $UBUNTUINSTALL is not 0.
  10. Proot-distro Debian Bookworm environment with Box64, Wine64, and Winetricks: Configures Debian Bookworm ARM64 proot-distro instance with alias $DEBIANBOX if $DEBIANBOX is not empty string, and install Box64, Wine64, and Winetricks in it if $DEBIANBOX is not empty string and $DEBIANBOXINSTALL is not 0.
  11. Andronix Debian Buster CLI-only environment with development tools: Creates CLI-only Debian Buster ARM64 proot environments in ~/$BUSTERCLI if $BUSTERCLI is not empty string, using scripts from Andronix, and install development tools in it if $BUSTERCLI is not empty string and $BUSTERCLIINSTALL is not 0.
  12. Andronix Debian Buster environment with XFCE and VNC: Creates Debian Buster ARM64 proot environments with XFCE and VNC server configured in ~/$BUSTERXFCE if $BUSTERXFCE is not empty string, using scripts from Andronix.
  13. VM booting shortcuts: Creates shortcuts to boot each installed VM in .shortcuts for Termux:Widget and the home directory (~).

Go to VM Setup Scripts for more details of the VM setup scripts invoked in termux-setup.sh.

VM Setup Scripts

These scripts will be invoked by Termux Setup if corresponding configuration is set.

  • debian-xfce-mod.sh: Modified version of Andronix's debian-xfce.sh, which installs and configures Debian Buster ARM64 proot environment with XFCE GUI support and related tools. Invoked for the $BUSTERXFCE Debian Buster proot environment.
  • debian-buster.sh: Installs developer tools for Debian Buster ARM64 instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 11, Node.js, Go, Ruby, Perl, GitHub, SSL, SSH, JQ, Maven, Zsh, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, and more. Invoked for the $DEBIANCLI Debian Buster proot environment.
  • debian-bookworm.sh: Installs developer tools for Debian Bookworm instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 17, Node.js, Rust, Go, Ruby, Perl, GitHub, SSL, SSH, Pandoc, TeX Live, Maven, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, Noto Sans CJK, STIX Two Math, and more. It can be used for both QEMU and Proot Debian Bookworm setups. The installation of fonts is compatible with my LaTeX template in LaTeX-ToolKit. Invoked for the Debian Bookworm ARM64 proot-distro instance with alias $DEBIAN.
  • box64-wine64-winetricks.sh: Installs box64, wine64, and winetricks for running x86_64 Linux and Windows applications on an ARM64 Linux instance. Invoked for the Debian Bookworm ARM64 proot-distro instance with alias $DEBIANBOX.
  • ubuntu-24-04.sh: Installs developer tools for Ubuntu 24.04 instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 17, Node.js, Rust, Go, Ruby, Perl, GitHub, SSL, SSH, Pandoc, TeX Live, Maven, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, Noto Sans CJK, STIX Two Math, and more. It can be used for both QEMU and Proot Debian Bookworm setups. The installation of fonts is compatible with my LaTeX template in LaTeX-ToolKit. Invoked for the Ubuntu 24.04 ARM64 proot-distro instance with alias $UBUNTU.

Shortcuts

Shortcuts are located in DOTshortcuts. Some of them are intended for tools that is not installed or configured in the Termux Setup, such as QEMU. Some related scripts and instructions are in Additional Scripts and Instructions.

Boot VM Scripts

Utility Scripts

  • bashrc.sh: A customized .bashrc for Termux with pre-defined aliases, functions, and environment variables for Tor, Git, Go, ANTLR4, etc.
  • gitPull.sh: git pull all repositories in ~/gh.
  • code.sh, download.sh: cd /storage/emulated/0/Documents/code and cd /storage/emulated/0/Download respectively.
  • xmrig.sh: Mines XMR to the repository owner's wallet, 48j6iQDeCSDeH46gw4dPJnMsa6TQzPa6WJaYbBS9JJucKqg9Mkt5EDe9nSkES3b8u7V6XJfL8neAPAtbEpmV2f4XC7bdbkv, using xmrig, which is not installed in the Termux Setup and can be installed with xmrig-install.sh. Change the wallet address and other configurations if you need.
  • shizuku.sh: cd shizuku and sh rish. This is a shortcuts for Shizuku, which is not configured in the scripts in this repository. Please refer to the section of my tutorial "Android-Non-Root" about it for more information.
  • termux-backup-bz.sh: Creates a compressed backup with the highest compression level of BZIP2 of the /data/data/com.termux/files/home and /data/data/com.termux/files/usr, then splits the resulting archive into parts, each 4000MB in size.
  • android-backup-bz.sh: Creates a compressed backup with the highest compression level of BZIP2 of the /storage/emulated/0/Files, /storage/emulated/0/DCIM, /storage/emulated/0/Pictures, /storage/emulated/0/Alarms, and /storage/emulated/0/Documents, then splits the resulting archive into parts, each 4000MB in size.
  • start-audio.sh: Starts sound output from Termux. Configured in Termux Setup according to https://docs.andronix.app/troubleshoot/sound.

Additional Scripts and Instructions

These scripts are not invoked by Termux Setup. Run it separately if you need it.


TODO

  • Make the configuration in termux-setup.sh more customizable.
  • Modularize scripts for flexibility and reusability.
  • Expand VMs and development tools support.

License

This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.


References

About

Termux setup and utility scripts for development tools, proot, QEMU, box86, and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages