Skip to content

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 are in Android-Non-Root, which includes tutorials for a range of powerful, open-source tools such as Termux, F-Droid, Shizuku, Tor, TrackerControl, InviZible Pro, QEMU, Tailscale, OpenSSH, and PipePipe to enhance Android device’s functionality, security, privacy, and customization without the need for root access.


Table of Contents


Termux Setup (termux-setup.sh)

Prerequisites

  • Sufficient storage:
    • Approximately 18.5 GB (outdated) for default configuration, i.e.,
      DEBIAN='debian'
      DEBIANINSTALL=1
      UBUNTU='ubuntu'
      UBUNTUINSTALL=0
      DEBIANBOX=''
      DEBIANBOXINSTALL=0
      
    • Approximately - GB (haven't been counted) for configuration of:
      DEBIAN='debian'
      DEBIANINSTALL=1
      UBUNTU='ubuntu'
      UBUNTUINSTALL=1
      DEBIANBOX=''
      DEBIANBOXINSTALL=0
      
    • Approximately 30.1 GB (outdated) for configuration of:
      DEBIAN='debian'
      DEBIANINSTALL=1
      UBUNTU='ubuntu'
      UBUNTUINSTALL=1
      DEBIANBOX='debianbox'
      DEBIANBOXINSTALL=1
      
  • Sufficient power supply.
  • Stable internet connection.
  • 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 tutorial about it in my **Android Non Root**: for the fixes.

Execution

  1. It is recommended to run termux-change-repo and choose a mirror close to your geographic location.
  2. termux-setup-storage
    pkg update && pkg install git -y
    cd ~ && git clone https://github.com/Willie169/termux-sh.git
    
  3. 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
    
  4. Run the setup script:
    bash ~/termux-sh/termux-setup.sh
    
  5. Follow the prompts until it exits automatically.

Content

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 ones include tools for C, C++, COBOL, Python3, Java17, Java21, Node.js, Rust, Go, Ruby, Perl, GitHub CLI, GitLab CLI, OpenSSL, OpenSSH, JQ, Ghostscript, FFMPEG, Maven, Zsh, Termux-X11, TigerVNC, XFCE4, PRoot, RARLAB UnRAR, Icarus Verilog, jpegoptim, optipng, Matplotlib, Ninja, SciPy, and more.
  2. Shortcut configuration: Copies shortcuts (including all VM-boosting shortcuts even if those VMs are not configured to be installed) from DOTshortcuts into .shortcuts (for Termux:Widget) and the home directory (~) and renames ~/bashrc.sh to ~/.bashrc.
  3. Vim configuration: Install vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim if not VIMRC=0. See Vimrc section for Vim and Nvim usage.
  4. Termux properties adjustments: Enables external app access in termux.properties.
  5. Termux PRoot environment: Installs termux-proot by Yonle, a Termux PRoot environment, with proot-termux.sh, if not PROOTTERMUX=0.
  6. Node.js tools: Installs nvm, pnpm, and Yarn, and installs NPM packages set in $NPM globally.
  7. Python packages: Installs pip packages set in PIPINSTALL in it if PIPINSTALL is not empty. The default ones are jupyter meson numpy pandas pipx pydub selenium setuptools sympy.
  8. Fabric installation: Installs Go package fabric, an open-source modular framework for augmenting humans using Al using a crowdsourced set of Al prompts.
  9. Proot-distro Debian Bookworm environment with development tools: Installs Debian ARM64 proot-distro environment with alias $DEBIAN if $DEBIAN is not empty string, and runs debian.sh in it if $DEBIAN is not empty string and $DEBIANINSTALL is not 0. See Invoked VM Setup Scripts section the script.
  10. Proot-distro Ubuntu environment with development tools: Installs an Ubuntu ARM64 proot-distro environment with alias $UBUNTU if $UBUNTU is not empty string, and runs ubuntu.sh in it if $UBUNTU is not empty string and $UBUNTUINSTALL is not 0. See Invoked VM Setup Scripts section the script.
  11. Proot-distro Debian Bookworm environment with Box64, Wine64, and Winetricks: Installs Debian ARM64 proot-distro environment with alias $DEBIANBOX if $DEBIANBOX is not empty string, and runs box64-wine64-winetricks.sh in it if $DEBIANBOX is not empty string and $DEBIANBOXINSTALL is not 0. See Invoked VM Setup Scripts section the script.

Invoked VM Setup Scripts

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

  • debian.sh: Configures PulseAudio and installs development tools, runtime environments, and utilities for C, C++, COBOL, Python3, Java (default-jdk), Node.js, Yarn, Rust, Go, Ruby, Perl, Aptitude, GitHub CLI, OpenSSL, OpenSSH, FFMPEG, Pandoc, TeX Live, iproute2, net-tools, nvm, pnpm, Yarn, Node.js packages, Python3 packages in ~/.env, pipx, Poetry, uv, XITS fonts, Noto CJK fonts, UnRAR-free, Icarus Verilog, Verilator, jpegoptim, optipng, SDL2, SDL2 BGI, TigerVNC server, XFCE desktop environment, vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim, my LaTeX package physics-patch, my LaTeX template LaTeX-ToolKit, and more, and adds custom ~/.bashrc on Debian ARM64. Invoked for the Debian ARM64 proot-distro environment with alias $DEBIAN. See Vimrc section for Vim and Nvim usage.
  • ubuntu.sh: Configures PulseAudio and installs development tools, runtime environments, and utilities for C, C++, COBOL, Python3, Java (default-jdk), Node.js, Yarn, Rust, Go, Ruby, Perl, Aptitude, GitHub CLI, OpenSSL, OpenSSH, FFMPEG, Pandoc, TeX Live, iproute2, net-tools, nvm, pnpm, Yarn, Node.js packages, Python3 packages in ~/.env, pipx, Poetry, uv, XITS fonts, Noto CJK fonts, RARLAB UnRAR, Icarus Verilog, Verilator, jpegoptim, optipng, SDL2, SDL2 BGI, TigerVNC server, XFCE desktop environment, vimrc by Amir Salihefendic (amix) with my customization for both Vim and Neovim, my LaTeX package physics-patch, my LaTeX template LaTeX-ToolKit, and more, and adds custom ~/.bashrc on Ubuntu ARM64. Invoked for the Ubuntu ARM64 proot-distro environment with alias $UBUNTU. See Vimrc section for Vim and Nvim usage.
  • 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 ARM64 proot-distro instance with alias $DEBIANBOX.

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 are in Additional Scripts.

Boot VM Scripts

Utility Scripts

  • bashrc.sh: A customized .bashrc for Termux with pre-defined aliases, functions, environment variables for development tools and human usages, PulseAudio setup, etc.
  • vimrc: A customized .vimrc.
  • 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.

Additional Scripts

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


Instructions

Vimrc

  • Edit your customizations in ~/vim_runtime/my_configs.vim.
  • Setup GitHub Copilot with :Copilot setup.
  • install-tools-first.sh disable GitHub Copilot by default. To enable it, remove let g:copilot_enabled = v:false from ~/vim_runtime/my_configs.vim. Run :let g:copilot_enabled = v:false to disable GitHub Copilot temporarily. Run :let g:copilot_enabled = v:true to enable GitHub Copilot temporarily. Add let g:copilot_enabled = v:false to ~/vim_runtime/my_configs.vim to disable GitHub Copilot globally.
  • See vimrc by Amir Salihefendic (amix) for more information.

My Related Repositories


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

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages