├── LICENSE ├── README.md └── termux-bootstrap /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Aayush 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Termux Bootstrap 2 | 3 | ## Table of Contents 4 | 5 | - [Termux Bootstrap](#termux-bootstrap) 6 | - [Overview](#overview) 7 | - [Requirements](#requirements) 8 | - [How to Use](#how-to-use) 9 | - [Method 1: Using curl](#method-1-using-curl) 10 | - [Method 2: Using Git](#method-2-using-git) 11 | - [Features](#features) 12 | 13 | ## Overview 14 | 15 | Termux Bootstrap is a lightweight script designed to streamline the setup process for Termux, a powerful terminal emulator for Android. It simplifies the initial configuration by installing essential packages, tools, and utilities, making Termux more convenient and feature-rich right from the start. 16 | 17 | ## Requirements 18 | 19 | - Android device with Termux installed from [F-Droid](https://f-droid.org/packages/com.termux/) 20 | - Stable internet connection to download required packages. 21 | 22 | ## How to Use 23 | There are two ways to run the Termux Bootstrap script: 24 | 25 | ### Method 1: Using curl 26 | 1. Open the Termux app on your Android device. 27 | 28 | 2. Run the following command to execute the bootstrap script using curl: 29 | 30 | ```bash 31 | curl -fsSL https://maglit.me/termux | bash 32 | ``` 33 | 34 | 3. Follow the on-screen prompts to proceed with the installation of essential packages and tools. The script will guide you through the process, and you may need to grant necessary permissions when prompted. 35 | 36 | 4. Once the installation is complete, restart Termux to apply the changes. 37 | 38 | ### Method 2: Using Git 39 | 1. Open the Termux app on your Android device. 40 | 41 | 2. Install Git (if you haven't already) by running the following command: 42 | ``` 43 | pkg install git 44 | ``` 45 | 46 | 3. Clone the Termux Bootstrap repository using Git: 47 | ``` 48 | git clone https://github.com/archelaus/termux-bootstrap.git 49 | ``` 50 | 51 | 4. Navigate to the cloned directory: 52 | ``` 53 | cd termux-bootstrap 54 | ``` 55 | 56 | 5. Make the script executable: 57 | ``` 58 | chmod +x termux-bootstrap 59 | ``` 60 | 61 | 6. Run the bootstrap script: 62 | ``` 63 | ./termux-bootstrap 64 | ``` 65 | 66 | 7. Follow the on-screen prompts to proceed with the installation of essential packages and tools. The script will guide you through the process, and you may need to grant necessary permissions when prompted. 67 | 68 | 8. Once the installation is complete, restart Termux to apply the changes. 69 | 70 | ## Features 71 | - Installs various useful packages, such as fzf, git, git-crypt, neovim, openssh, rsync, vim, and wget. 72 | - Installs Python and sets up essential Python libraries like pipx. 73 | - Sets the default shell to Fish for a better terminal experience. 74 | - Creates a `.hushlogin` file to suppress login messages. 75 | 76 | Note: The script in the code might be subject to updates and improvements. Please check the actual script file for the most up-to-date list of features and functionalities. 77 | 78 | ## Contribution 79 | 80 | If you encounter any issues, have suggestions, or want to contribute to the project, feel free to create a pull request or open an issue on the [GitHub repository](https://github.com/archelaus/termux-bootstrap). 81 | 82 | ## Disclaimer 83 | 84 | This script is provided as-is and without any warranties. Use it at your own risk. Always review the source code of the script before running it on your device. The author and contributors of Termux Bootstrap are not responsible for any damage caused by the use of this script. 85 | 86 | ## License 87 | 88 | Termux Bootstrap is licensed under the [MIT License](LICENSE). 89 | -------------------------------------------------------------------------------- /termux-bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cecho() { 6 | local code="\033[" 7 | case $1 in 8 | black | bk) color="${code}0;30m";; 9 | red | r) color="${code}1;31m";; 10 | green | g) color="${code}1;32m";; 11 | yellow | y) color="${code}1;33m";; 12 | blue | b) color="${code}1;34m";; 13 | purple | p) color="${code}1;35m";; 14 | cyan | c) color="${code}1;36m";; 15 | gray | gr) color="${code}0;37m";; 16 | *) local text="$1" 17 | esac 18 | [[ $text ]] || local text="$color$2${code}0m" 19 | echo -e "$text" 20 | } 21 | 22 | checkBin() { 23 | command -v "$1" &>/dev/null 24 | } 25 | 26 | mkdirs() { 27 | [[ -d $1 ]] || mkdir -p "$1" 28 | cecho g "Done!" 29 | } 30 | 31 | packages="fish fzf git git-crypt neovim openssh rsync termux-api vim wget" 32 | 33 | cecho g "¶ Updating default packages" 34 | pkg update -y 35 | 36 | cecho g "\n¶ Installing packages" 37 | pkg install -y $packages 38 | 39 | cecho g "\n¶ Installing python" 40 | pkg install -y python 41 | 42 | checkBin pipx || { 43 | cecho g "\n¶ Setting up python libs" 44 | pip3 install pipx 45 | # pipx ensurepath 46 | 47 | pipx install trash-cli 48 | pipx install yt-dlp 49 | pipx install yturl 50 | } 51 | 52 | cecho y "\n¶ Creating the YouTube folder to download the files" 53 | mkdirs ~/storage/shared/Download/YouTube 54 | 55 | cecho y "\n¶ Creating yt-dlp folder for config" 56 | mkdirs ~/.config/yt-dlp 57 | 58 | cecho y "\n¶ Creating bin folder" 59 | mkdirs ~/bin 60 | 61 | cecho y "\n¶ Setting default shell to fish" 62 | chsh -s "$(type fish)" && cecho g "Done!" 63 | 64 | ls ~/storage/shared &>/dev/null || { 65 | cecho g "\n¶ Setting up storage access for Termux" 66 | termux-setup-storage 67 | sleep 5 68 | } 69 | 70 | [[ -d ./termux-style ]] || { 71 | cecho g "\n¶ Installing termux-style" 72 | git clone https://github.com/adi1090x/termux-style 73 | cd termux-style 74 | chmod +x install 75 | ./install 76 | # termux-style 77 | } 78 | 79 | touch ~/.hushlogin 80 | --------------------------------------------------------------------------------