├── .gitignore ├── .termux ├── MesloLGS_NF_Bold.ttf ├── colors.properties.dark_blue └── colors.properties.light_blue ├── LICENSE ├── README.md ├── bin ├── apm ├── arc ├── prettify ├── rxfetch └── termux-url-opener ├── scripts ├── debian.sh └── k.sh └── setup.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.termux/MesloLGS_NF_Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anonymousx97/termux-setup/84abf061a8ed11fa11d2c8bdc75fc68e062066f9/.termux/MesloLGS_NF_Bold.ttf -------------------------------------------------------------------------------- /.termux/colors.properties.dark_blue: -------------------------------------------------------------------------------- 1 | background=#090D13 2 | foreground=#FEFEFE 3 | cursor=#E96B72 4 | color0=#00050D 5 | color1=#E96B72 6 | color2=#90B261 7 | color3=#F8AE4E 8 | color4=#52BCF9 9 | color5=#F9E893 10 | color6=#8FE0C5 11 | color7=#C6C6C6 12 | color8=#676767 13 | color9=#EF7077 14 | color10=#C1D84B 15 | color11=#FEB353 16 | color12=#58C1FE 17 | color13=#FEED98 18 | color14=#94E5CA 19 | color15=#FEFEFE 20 | -------------------------------------------------------------------------------- /.termux/colors.properties.light_blue: -------------------------------------------------------------------------------- 1 | # Credits: https://github.com/mayTermux/mytermux 2 | 3 | color0=#2f343f 4 | color1=#fd6b85 5 | color2=#63e0be 6 | color3=#fed270 7 | color4=#67d4f2 8 | color5=#ff8167 9 | color6=#63e0be 10 | color7=#eeeeee 11 | color8=#4f4f5b 12 | color9=#fd6b85 13 | color10=#63e0be 14 | color11=#fed270 15 | color12=#67d4f2 16 | color13=#ff8167 17 | color14=#63e0be 18 | color15=#eeeeee 19 | background=#2a2c3a 20 | foreground=#eeeeee 21 | cursor=#fd6b85 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Ryuk 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 Setup 2 | 3 | ### A script to auto-install few packages and customise termux. 4 | ![image](https://github.com/anonymousx97/termux-setup/assets/88324835/424eafa8-d0bb-4b6b-a033-b45b5d878dcc) 5 | 6 | 7 | >It was made because Ryuk was ~~LAZY~~ tired of setting up termux again and again. XD 8 | 9 | ### Previews 10 |
11 | termux-url-opener: 12 | 13 | https://github.com/anonymousx97/termux-setup/assets/88324835/9ba12b6a-e53c-47df-88b8-51585666cd5e 14 | 15 |
16 |
17 | arc: 18 | 19 | https://github.com/anonymousx97/termux-setup/assets/88324835/a1067ff9-9c31-40d8-82bf-c2c10dbc11f3 20 | 21 |
22 | 23 | ### Installation 24 | Download Termux: 25 | [**GitHub**](https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_universal.apk) | [**F-Droid**](https://f-droid.org/repo/com.termux_118.apk) 26 | 27 | Run: 28 | 29 | ```bash 30 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/anonymousx97/termux-setup/main/setup.sh)" 31 | ``` 32 | ### Credits 33 | * By: Ryuk [ [TG](https://t.me/anonymousx97) | [GitHub](https://github.com/anonymousx97) ] 34 | * [mayTrmux](https://github.com/mayTermux) for original _color.properties & rxfetch_ 35 | * Packages Used: 36 | * APT : 37 | 38 | aria2 39 | curl 40 | ffmpeg 41 | git 42 | gh 43 | openssh 44 | python 45 | python-pip 46 | python-pillow 47 | sshpass 48 | tmux 49 | tsu 50 | wget 51 | 52 | * PIP : 53 | 54 | yt-dlp 55 | black 56 | isort 57 | autopep8 58 | autoflake 59 | -------------------------------------------------------------------------------- /bin/apm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import subprocess 5 | import sys 6 | import termios 7 | import tty 8 | 9 | ARG_MAP = { 10 | "-d": "disable", 11 | "-e": "enable", 12 | "-u": "uninstall", 13 | } 14 | 15 | RAW_PACKAGES_LIST: list[str] = [] 16 | PACKAGE_LIST: list[str] = [] 17 | 18 | 19 | class Colors: 20 | CYAN = "\033[96m" 21 | RED = "\033[91m" 22 | ENDC = "\033[0m" 23 | 24 | 25 | # Check for valid args. Exit if incorrect. 26 | try: 27 | assert ARG_MAP.get(sys.argv[1]) 28 | ACTION = ARG_MAP[sys.argv[1]] 29 | 30 | except (AssertionError, IndexError): 31 | print( 32 | f"""{Colors.RED}Invalid Command!{Colors.ENDC} 33 | 34 | Usage: 35 | -e : Enable the app 36 | -d : Disable the app 37 | -u : Uninstall the app 38 | """ 39 | ) 40 | sys.exit(1) 41 | 42 | 43 | class Keys: 44 | KEY = "\x1b" 45 | UP = "\x1b[A" 46 | DOWN = "\x1b[B" 47 | BACKSPACE = "\x7f" 48 | CTRL_C = "\x03" 49 | CTRL_Z = "\x1a" 50 | 51 | ALLOWED_KEYS = (KEY, UP, DOWN, BACKSPACE, CTRL_C, CTRL_Z) 52 | 53 | 54 | class Manager: 55 | 56 | def __init__(self): 57 | os.system("printf '\e[?25l'") 58 | 59 | self.search_term: str = "" 60 | self.selected_package: str = "" 61 | self.selected_index: int = 0 62 | 63 | # Save Old Terminal Settings to restore on exit. 64 | self.stdin_file_descriptor = sys.stdin.fileno() 65 | self.old_terminal_settings = termios.tcgetattr(self.stdin_file_descriptor) 66 | 67 | # Set Terminal to Live Input Mode 68 | tty.setcbreak(self.stdin_file_descriptor) 69 | 70 | # Setup Display Area 71 | self.reset_output_area(count=5, indent=True) 72 | 73 | def clear_package_data(self) -> None: 74 | self.search_term: str = "" 75 | self.selected_package: str = "" 76 | self.selected_index: int = 0 77 | 78 | def handle_user_input(self) -> None: 79 | """Start Waiting for Input""" 80 | 81 | while 1: 82 | 83 | previous_menu_length: int = self.show_package_options() 84 | self.reset_output_area(previous_menu_length) 85 | 86 | user_input = sys.stdin.read(1) 87 | 88 | match user_input: 89 | # Extra Precautions for Live Read mode 90 | case (Keys.CTRL_C, Keys.CTRL_Z): 91 | self.cleanup_and_exit(0) 92 | 93 | # No Spaces 94 | case " ": 95 | continue 96 | 97 | # If the up/down key was pressed, read it's value 98 | case Keys.KEY: 99 | user_input += sys.stdin.read(2) 100 | 101 | match user_input: 102 | case Keys.UP: 103 | # Decrease Index by one to move up in menu 104 | self.selected_index -= 1 105 | 106 | case Keys.DOWN: 107 | # Increase Index by one to move down in menu 108 | self.selected_index += 1 109 | 110 | # Clear One Letter 111 | case Keys.BACKSPACE: 112 | self.search_term = self.search_term[:-1] 113 | 114 | # If search term is empty, delete stored data 115 | if not self.search_term: 116 | self.clear_package_data() 117 | 118 | # Perform the arg task on enter 119 | case "\n": 120 | if self.selected_package: 121 | sys.stdout.flush() 122 | self.apply_package_action() 123 | self.clear_package_data() 124 | self.reset_output_area(count=5, indent=True) 125 | 126 | case _: 127 | if user_input.isalnum(): 128 | self.search_term += user_input 129 | 130 | def show_input_bar(self) -> None: 131 | """Show Query""" 132 | # Clear Input Line and Go to the Beginning 133 | sys.stdout.write("\033[K\r") 134 | 135 | # Print Input 136 | sys.stdout.write("app name: " + self.search_term) 137 | 138 | def show_package_options(self) -> int: 139 | """Show top 5 packages""" 140 | sys.stdout.flush() 141 | 142 | self.show_input_bar() 143 | 144 | menu, menu_len = self.format_package_menu() 145 | 146 | # Print Menu 147 | sys.stdout.write(menu) 148 | 149 | sys.stdout.flush() 150 | 151 | return menu_len 152 | 153 | @staticmethod 154 | def highlight_selected_package(package_name: str) -> str: 155 | """ 156 | Highlights the selected package with color. 157 | """ 158 | return f"{Colors.RED}>{Colors.ENDC} {Colors.CYAN}{package_name}{Colors.ENDC}" 159 | 160 | def format_package_menu(self) -> tuple[str, int]: 161 | """ 162 | Builds the menu string based on the input and package list. 163 | """ 164 | if not self.search_term: 165 | self.clear_package_data() 166 | return "", 0 167 | 168 | packages = [pkg for pkg in PACKAGE_LIST if self.search_term in pkg][0:5] 169 | 170 | if not packages: 171 | self.selected_package = "" 172 | return "", 0 173 | 174 | # Check current index 175 | try: 176 | packages[self.selected_index] 177 | except IndexError: 178 | self.selected_index = 0 179 | 180 | self.selected_package = packages[self.selected_index] 181 | 182 | packages[self.selected_index] = self.highlight_selected_package( 183 | self.selected_package 184 | ) 185 | 186 | return "\n" + "\n".join(packages), len(packages) 187 | 188 | @staticmethod 189 | def reset_output_area(count: int, indent=False) -> None: 190 | """Clear or Adjust Display""" 191 | 192 | # Flush any characters on screen 193 | sys.stdout.flush() 194 | 195 | if indent: 196 | # Adjust Screen if there's no space left 197 | sys.stdout.write("\n" * (count + 1)) 198 | 199 | # Move Line to the end 200 | sys.stdout.write("\033[E") 201 | 202 | # Move one line up each step for each entry in menu and clear it 203 | for _ in range(count + 1): 204 | sys.stdout.write("\033[F\033[K") 205 | 206 | def apply_package_action(self) -> None: 207 | """Enable / Disable / Uninstall app""" 208 | subprocess.call( 209 | f"su -c 'pm {ACTION} --user 0 {self.selected_package}'", shell=True 210 | ) 211 | 212 | def cleanup_and_exit(self, exit_code: int) -> None: 213 | """Restore everything and exit""" 214 | 215 | # Reset Terminal and Turn off Live Read mode. 216 | termios.tcsetattr( 217 | self.stdin_file_descriptor, termios.TCSADRAIN, self.old_terminal_settings 218 | ) 219 | 220 | # Clear any Remaining characters on screen 221 | sys.stdout.write("\r\033[K") 222 | 223 | # Re-enable Cursor 224 | os.system("printf '\e[?25h'") 225 | 226 | sys.exit(exit_code) 227 | 228 | 229 | def check_su() -> None: 230 | # Look For SU binary to use. 231 | su_paths = [ 232 | "/sbin/su", 233 | "/system/sbin/su", 234 | "/system/bin/su", 235 | "/system/xbin/su", 236 | "/su/bin/su", 237 | "/magisk/.core/bin/su", 238 | ] 239 | for path in su_paths: 240 | if os.path.isfile(path): 241 | return 242 | else: 243 | print("SU Binary not found\nAre you Rooted?") 244 | sys.exit(1) 245 | 246 | 247 | if __name__ == "__main__": 248 | check_su() 249 | # Get List of Installed packages using root 250 | RAW_PACKAGES_LIST = ( 251 | subprocess.check_output("su -c pm list packages", shell=True) 252 | .decode("utf-8") 253 | .split() 254 | ) 255 | 256 | # Strip package names 257 | PACKAGE_LIST = [pkg.removeprefix("package:") for pkg in RAW_PACKAGES_LIST] 258 | 259 | exit_code = 0 260 | manager = Manager() 261 | try: 262 | manager.handle_user_input() 263 | except Exception as e: 264 | exit_code = 1 265 | print(e) 266 | finally: 267 | manager.cleanup_and_exit(exit_code=exit_code) 268 | -------------------------------------------------------------------------------- /bin/arc: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | read -r -p 'Link or Magnet 4 | > ' x 5 | 6 | echo -e "${x}\n" >> /data/data/com.termux/files/home/.arc_history 7 | 8 | echo 9 | 10 | aria2c \ 11 | -d /sdcard/Download \ 12 | --console-log-level=warn \ 13 | --summary-interval=0 \ 14 | --seed-time=0 \ 15 | --file-allocation=none \ 16 | "${x}" 17 | -------------------------------------------------------------------------------- /bin/prettify: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | function exit_with_error(){ 4 | echo "$1" >&2 5 | exit 1 6 | } 7 | 8 | 9 | if [[ -z "$1" ]];then 10 | exit_with_error "Give a file or path to files." 11 | 12 | elif [[ ! -f "$1" && ! -d "$1" ]]; then 13 | exit_with_error "No such file or directory." 14 | fi 15 | 16 | 17 | isort --honor-noqa --reverse-relative --skip-glob "**__init__.py" "$1" 18 | black "$1" 19 | autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports "$1" 20 | -------------------------------------------------------------------------------- /bin/rxfetch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Credits: https://github.com/mayTermux/rxfetch-termux 4 | # Modified for personal use by Anonymousx97 5 | 6 | magenta="\033[1;35m" 7 | green="\033[1;32m" 8 | white="\033[1;37m" 9 | blue="\033[1;34m" 10 | red="\033[1;31m" 11 | black="\033[1;40;30m" 12 | yellow="\033[1;33m" 13 | cyan="\033[1;36m" 14 | reset="\033[0m" 15 | bgyellow="\033[1;43;33m" 16 | 17 | 18 | to_print=() 19 | 20 | 21 | function getCodeName() { 22 | codename="$(getprop ro.product.board)" 23 | } 24 | 25 | 26 | function getClientBase() { 27 | client_base="$(getprop ro.com.google.clientidbase)" 28 | } 29 | 30 | 31 | function getModel() { 32 | model="$(getprop ro.product.system.model)" 33 | if [ -z "${model}" ] ; then 34 | to_print+=(" ┃ ┃") 35 | return 36 | fi 37 | to_print+=(" ┃ ┃ ${magenta}phone${reset} ${model}") 38 | } 39 | 40 | 41 | function getDistro() { 42 | os="$(uname -o) $(uname -m)" 43 | to_print+=(" ┃ ${white}•${black}_${white}•${reset} ┃ ${green}os${reset} ${os}") 44 | } 45 | 46 | 47 | function getKernel() { 48 | kernel="$(uname -r)" 49 | to_print+=(" ┃ ${black}${reset}${bgyellow}oo${reset}${black}|${reset} ┃ ${cyan}ker${reset} ${kernel}") 50 | } 51 | 52 | 53 | function getTotalPackages() { 54 | aptpackages=$(apt list --installed 2>/dev/null | wc -l) 55 | to_print+=(" ┃ ${black}/${reset}${bghwite} ${reset}${black}'\'${reset} ┃ ${blue}pkgs${reset} ${aptpackages}") 56 | } 57 | 58 | 59 | function getShell() { 60 | if [ -G "${HOME}/.termux/shell" ]; then 61 | shell="$(basename "$(realpath "${HOME}/.termux/shell")")" 62 | else 63 | for file in /data/data/com.termux/files/usr/bin/bash /data/data/com.termux/files/usr/bin/sh /system/bin/sh; do 64 | if [ -x "${file}" ]; then 65 | shell="$(basename ${file})" 66 | break 67 | fi 68 | done 69 | fi 70 | to_print+=(" ┃ ${bgyellow}(${reset}${black}\_;/${reset}${bgyellow})${reset} ┃ ${red}sh${reset} ${shell}") 71 | } 72 | 73 | 74 | function getUptime() { 75 | uptime="$(uptime --pretty | sed 's/up//')" 76 | to_print+=(" ┃ ┃ ${yellow}up${reset} ${uptime}") 77 | } 78 | 79 | 80 | function getMemoryUsage() { 81 | #memory="$(free --mega | sed -n -E '2s/^[^0-9]*([0-9]+) *([0-9]+).*/'"${space}"'\2 \/ \1MB/p')" 82 | _MEM="Mem:" 83 | _GREP_ONE_ROW="$(free --mega | grep "${_MEM}")" 84 | _TOTAL="$(echo "${_GREP_ONE_ROW}" | awk '{print $2}')" 85 | _USED="$(echo "${_GREP_ONE_ROW}" | awk '{print $3}')" 86 | 87 | memory="${_USED}MB ${red}/${reset} ${_TOTAL}MB" 88 | to_print+=(" ┃ Android 🧡 Termux ┃ ${magenta}ram${reset} ${memory}") 89 | } 90 | 91 | 92 | function getDiskUsage() { 93 | read -r -a _STORAGE_INFO <<< "$(df -h | grep '/storage/emulated')" 94 | 95 | # Thanks Octavia OS for breaking mounts ;_; 96 | if [[ ${#_STORAGE_INFO[@]} -eq 0 ]]; then 97 | for _su in /sbin/su /system/sbin/su /system/bin/su /system/xbin/su /su/bin/su /magisk/.core/bin/su 98 | do 99 | if [ -x $_su ]; then 100 | read -r -a _STORAGE_INFO <<< "$($_su -c "df -h | grep '/data/media'")" 101 | break 102 | fi 103 | done 104 | fi 105 | 106 | if [[ "${#_STORAGE_INFO[@]}" -eq 0 ]]; then 107 | return 108 | fi 109 | 110 | _SIZE="${_STORAGE_INFO[1]}" 111 | _USED="${_STORAGE_INFO[2]}" 112 | _AVAIL="${_STORAGE_INFO[3]}" 113 | _USE="${_STORAGE_INFO[4]}" 114 | storage="${_USED}B${red} / ${reset}${_SIZE}B = ${green}${_AVAIL}B${reset} (${_USE})" 115 | to_print+=(" ┃ ┃ ${green}disk${reset} ${storage}") 116 | } 117 | 118 | 119 | function addInit() { 120 | to_print+=(" ┃ ┃ ${yellow}init${reset} init.rc") 121 | } 122 | 123 | 124 | function printRx() { 125 | echo -e "\n\n" 126 | echo -e " ┏━━━━━━━━━━━━━━━━━━━━━━━┓" 127 | echo -e " ┃ ${magenta}r${green}x${cyan}f${blue}e${red}t${yellow}${cyan}c${magenta}h${reset} ${red}${reset} ${yellow}${reset} ${cyan}${reset} ┃ ${codename}${red}@${reset}${client_base}" 128 | echo -e " ┣━━━━━━━━━━━━━━━━━━━━━━━┫" 129 | 130 | for i in "${to_print[@]}";do echo -e "${i}";done 131 | 132 | echo -e " ┗━━━━━━━━━━━━━━━━━━━━━━━┛ ${magenta}━━━${green}━━━${white}━━━${blue}━━━${red}━━━${yellow}━━━${cyan}━━━" 133 | echo -e "\n\n${reset}" 134 | } 135 | 136 | 137 | function main() { 138 | getCodeName 139 | getClientBase 140 | getModel 141 | getDistro 142 | getKernel 143 | getTotalPackages 144 | getShell 145 | addInit 146 | getUptime 147 | getMemoryUsage 148 | getDiskUsage 149 | printRx 150 | } 151 | 152 | main 153 | 154 | -------------------------------------------------------------------------------- /bin/termux-url-opener: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function arc_dl(){ 4 | arc <<< "${1}" 5 | } 6 | 7 | 8 | function yt_dl(){ 9 | echo -e "1. Audio : 160kbps Opus\n2. Best Video + Best Audio (Max Resolution)\n3. Download with custom args." 10 | 11 | while true; do 12 | read -r -p "> " x 13 | 14 | if [[ -z "${x}" ]]; then 15 | echo -e "Choose an option" 16 | 17 | elif [[ "${x}" -eq 1 ]];then 18 | echo -e "Downloading Audio" 19 | yt-dlp -o /sdcard/Download/YT_DLP/"%(title)s.%(ext)s" -x --audio-format opus --audio-quality 0 --embed-thumbnail "$1" 20 | break 21 | 22 | elif [[ "${x}" -eq 2 ]]; then 23 | yt-dlp -o /sdcard/Download/YT_DLP/"%(title)s.%(ext)s" -f "bv+ba/b" "$1" 24 | break 25 | 26 | elif [[ "${x}" -eq 3 ]]; then 27 | echo -e "yt-dlp args:" 28 | read -r -p "> " args 29 | yt-dlp "${args} ${1}" 30 | break 31 | 32 | else 33 | echo -e "Invalid Input: ${x}" 34 | fi 35 | done 36 | sleep 5 37 | } 38 | 39 | 40 | if grep -qE "^magnet:" <<< "${1}"; then 41 | arc_dl "${1}" 42 | else 43 | yt_dl "${1}" 44 | fi 45 | -------------------------------------------------------------------------------- /scripts/debian.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export DISPLAY=:0 XDG_RUNTIME_DIR=${TMPDIR} 4 | 5 | 6 | function KillRedundantProcess(){ 7 | for i in "dbus" "com.termux.x11" "Xwayland" "pulseaudio" "virgl_test_server_android"; 8 | do pkill -qif "${i}*"; 9 | done 10 | } 11 | 12 | 13 | KillRedundantProcess 14 | 15 | 16 | function supress_output(){ 17 | "$@" >/dev/null 2>&1 18 | } 19 | 20 | 21 | termux-wake-lock && echo "WakeLock Acquired" 22 | 23 | 24 | echo "X11 is Listening for incoming connections" 25 | 26 | 27 | supress_output \ 28 | termux-x11 :0 -ac & 29 | 30 | 31 | sleep 3 32 | 33 | 34 | echo "Starting XFCE4" 35 | 36 | 37 | supress_output \ 38 | am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity 39 | 40 | supress_output \ 41 | pulseaudio \ 42 | --start \ 43 | --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \ 44 | --exit-idle-time=-1 45 | 46 | 47 | supress_output \ 48 | pacmd \ 49 | load-module \ 50 | module-native-protocol-tcp \ 51 | auth-ip-acl=127.0.0.1 \ 52 | auth-anonymous=1 53 | 54 | supress_output \ 55 | virgl_test_server_android & 56 | 57 | supress_output \ 58 | proot-distro login debian \ 59 | --termux-home \ 60 | --shared-tmp \ 61 | -- bash -c " 62 | export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1 63 | dbus-launch --exit-with-session wm_start_cmd" 64 | 65 | 66 | termux-wake-unlock 67 | 68 | 69 | KillRedundantProcess 70 | -------------------------------------------------------------------------------- /scripts/k.sh: -------------------------------------------------------------------------------- 1 | # Kali nethunter arm64 2 | DISTRO_NAME="kali Nethunter (arm64)" 3 | DISTRO_COMMENT="Kali nethunter arm64 (official version)" 4 | TARBALL_URL['aarch64']="https://kali.download/nethunter-images/current/rootfs/kalifs-arm64-minimal.tar.xz" 5 | TARBALL_SHA256['aarch64']="b35534aa0dca0fdf4940836124efdb2faae2cb2e850182e82a8789da5b60b164" 6 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # By Ryuk Github | TG : [ anonymousx97 ] 4 | 5 | red="\033[1;31m" 6 | white="\033[0m" 7 | green="\033[1;32m" 8 | defaults=0 9 | 10 | 11 | start() { 12 | # Setup Storage Permissions 13 | ! [[ -w /sdcard && -r /sdcard ]] && termux-setup-storage 14 | 15 | clear 16 | 17 | local menu="${green}Main Menu:${white}" 18 | 19 | local options=" 20 | 1. Install Essential packages. 21 | 2. Customize Termux. 22 | 3. Both 1 & 2 (Uses Presets for customisation) 23 | 4. Setup Debian in Termux. 24 | 5. Exit 25 | " 26 | all() { 27 | export defaults=1 28 | package_setup 29 | customize 30 | } 31 | 32 | export start_options=( 33 | [1]="package_setup" 34 | [2]="customize" 35 | [3]="all" 36 | [4]="setup_debian" 37 | [5]="exit_" 38 | ) 39 | 40 | ask "${options}" "${menu}" "start_options" 41 | } 42 | 43 | 44 | customize() { 45 | clear 46 | local menu="${green}Customisation Menu:${white}" 47 | 48 | customize_all() { 49 | echo -e "${green}Customising All.${white}" 50 | export defaults=1 51 | setup_apm 52 | setup_aria2 53 | setup_ytdlp 54 | setup_prettify 55 | setup_rxfetch 56 | change_cursor 57 | change_ui 58 | sleep 2 59 | clear 60 | rxfetch 61 | } 62 | 63 | [[ $defaults -eq 1 ]] && customize_all && return 0 64 | 65 | export option_dict=( 66 | [1]="setup_apm" 67 | [2]="setup_aria2" 68 | [3]="setup_ytdlp" 69 | [4]="setup_prettify" 70 | [5]="setup_rxfetch" 71 | [6]="change_cursor" 72 | [7]="change_ui" 73 | [8]="customize_all" 74 | [9]="start" 75 | [10]="exit_" 76 | ) 77 | 78 | local options=" 79 | 1. Setup Android Package Manager by Ryuk. 80 | 2. Setup Aria2 Shortcut. 81 | 3. Enable Downloading Magnets or YT-DLP supported links by sharing to termux. 82 | 4. Setup 'prettify' Bunch of py formatting tools. 83 | 5. Setup Rxfetch. 84 | 6. Change Cursor Style. 85 | 7. Change Colour and Font. 86 | 8. All of the above. ( Uses Presets ) 87 | 9. Go back to previous menu. 88 | 10. Exit 89 | " 90 | 91 | ask "${options}" "${menu}" "option_dict" 92 | 93 | } 94 | 95 | 96 | ask() { 97 | local header="What do you want to do?" 98 | local option_text="$1" 99 | local menu="$2" 100 | local dict_name=$3 101 | 102 | echo -e "${menu}\n${header}${option_text}" 103 | 104 | while true; do 105 | 106 | read -r -p "> " choice 107 | 108 | if [ -z "${choice}" ]; then 109 | clear 110 | echo -e "${menu}\n${header}${red}\n Choose an Option.${white}${option_text}" 111 | 112 | elif [[ -v ${dict_name}[$choice] ]]; then 113 | eval "\${${dict_name}[$choice]}" 114 | break 115 | 116 | else 117 | clear 118 | echo -e "${menu}\n${header}${red}\n Invalid Input: ${white}${choice}${option_text}" 119 | fi 120 | 121 | done 122 | } 123 | 124 | 125 | package_setup() { 126 | # Update Termux Package Repository 127 | termux-change-repo 128 | 129 | yes | pkg upgrade 130 | apt update -y && apt upgrade -y 131 | 132 | # Install necessary packages 133 | apt install -y \ 134 | aria2 \ 135 | curl \ 136 | ffmpeg \ 137 | git \ 138 | gh \ 139 | openssh \ 140 | python \ 141 | python-pip \ 142 | tmux \ 143 | tsu \ 144 | wget 145 | 146 | # Update and Install pip packages 147 | pip install -U \ 148 | wheel \ 149 | setuptools \ 150 | yt-dlp \ 151 | black \ 152 | isort \ 153 | autoflake 154 | } 155 | 156 | 157 | setup_debian() { 158 | apt update 159 | apt install -y root-repo x11-repo 160 | apt install -y \ 161 | proot \ 162 | proot-distro \ 163 | termux-x11-nightly \ 164 | pulseaudio 165 | 166 | proot-distro install debian 167 | 168 | clear 169 | 170 | local options=" 171 | 1. Install xfce4 172 | 2. Install KDE 173 | 3. Exit 174 | " 175 | wm="" 176 | wm_cmd="" 177 | 178 | export wm_dict=( 179 | [1]="export wm=xfce4 wm_cmd=startxfce4" 180 | [2]="export wm=kde-standard wm_cmd=startplasma-x11" 181 | [3]="exit_" 182 | ) 183 | 184 | ask "${options}" "Window Manager Menu:" "wm_dict" 185 | 186 | proot-distro login debian --termux-home --shared-tmp -- bash -c " 187 | apt update -y 188 | 189 | apt install -y \ 190 | firefox-esr \ 191 | ${wm} \ 192 | xfce4-goodies \ 193 | locales \ 194 | fonts-noto-cjk 195 | 196 | ln -sf /usr/share/zoneinfo/Asia/Calcutta /etc/localtime 197 | 198 | echo en_US.UTF-8 UTF-8 >> /etc/locale.gen 199 | 200 | locale-gen 201 | 202 | echo 'LANG=en_US.UTF-8' > /etc/locale.conf 203 | " 204 | 205 | curl -s -O --output-dir "${HOME}" \ 206 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/scripts/debian.sh 207 | 208 | sed -i "s/wm_start_cmd/${wm_cmd}/" "${HOME}/debian.sh" 209 | 210 | echo ' 211 | alias dcli="proot-distro login debian --termux-home --shared-tmp -- bash" 212 | alias dgui="bash debian.sh" 213 | '>> "${HOME}/.bashrc" 214 | 215 | echo '[[ "$(whoami)" == "root" ]] && export HISTFILE=~/.debian_history' >> "${HOME}/.bashrc" 216 | 217 | echo "Done." 218 | 219 | echo -e "You can now use '${green}dcli${white}' for debian cli and '${green}dgui${white}' for GUI (Termux x11 app required)." 220 | 221 | } 222 | 223 | 224 | setup_apm() { 225 | echo -e "\n1. Downloading Android Package Manager By Ryuk." 226 | 227 | curl -s -O --output-dir "${PATH}" \ 228 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/bin/apm 229 | 230 | chmod +x "${PATH}/apm" 231 | 232 | echo -e "${green}Done.${white} use 'apm' to call it." 233 | } 234 | 235 | 236 | setup_aria2() { 237 | echo -e "\n2. Downloading Aria2 shortcut" 238 | 239 | curl -s -O --output-dir "${PATH}" \ 240 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/bin/arc 241 | 242 | chmod +x "${PATH}/arc" 243 | 244 | echo -e "${green}Done.${white}" 245 | } 246 | 247 | 248 | setup_ytdlp() { 249 | echo -e "\n3. Downloading files and Setting Up Magent & YT-DLP link share Trigger." 250 | 251 | mkdir -p "${HOME}/bin" 252 | 253 | curl -s -O --output-dir "${HOME}/bin" \ 254 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/bin/termux-url-opener 255 | 256 | echo -e "${green}Done.${white}" 257 | } 258 | 259 | 260 | setup_prettify() { 261 | echo -e "\n4. Downloading and Setting up Prettify script." 262 | 263 | curl -s -O --output-dir "${PATH}" \ 264 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/bin/prettify 265 | 266 | chmod +x "${PATH}/prettify" 267 | 268 | echo -e "${green}Done.${white}" 269 | } 270 | 271 | 272 | setup_rxfetch() { 273 | echo -e "\n5. Downloading and Setting up Rxfetch" 274 | 275 | curl -s -O --output-dir "${PATH}" \ 276 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/bin/rxfetch 277 | 278 | chmod +x "${PATH}/rxfetch" 279 | 280 | local motd="#!$SHELL\nbash rxfetch" 281 | 282 | if [[ -f ~/.termux/motd.sh && $defaults -eq 0 ]]; then 283 | echo -e "${red}A custom start script exists in the path ${HOME}/.termux/motd.sh${white}" 284 | echo -e " Enter 1 to overwrite the current file.\n Press Enter to skip." 285 | 286 | read -r -p "> " prompt 287 | 288 | if [[ ! "${prompt}" || ! "${prompt}" == 1 ]]; then 289 | echo -e "${green}Skipping motd modification.${white}" 290 | 291 | else 292 | echo -e "${red}Overwriting motd.${white}" 293 | echo -e "${motd}" > ~/.termux/motd.sh 294 | fi 295 | 296 | else 297 | echo -e "${motd}" > ~/.termux/motd.sh 298 | fi 299 | 300 | echo -e "${green}Done.${white}" 301 | } 302 | 303 | 304 | change_cursor() { 305 | echo -e "\n6. Changing Cursor" 306 | 307 | if [[ $defaults -eq 0 ]]; then 308 | clear 309 | 310 | local menu="Cursor Menu:" 311 | 312 | local options=" 313 | 1. Change to ${green}|${white} (bar) 314 | 2. Change to ${green}_${white} (underscore) 315 | 3. Change to Default Block style. 316 | 4. Exit 317 | " 318 | export cursor_dict=( 319 | [1]="eval printf '\e[6 q' && export style=bar" 320 | [2]="eval printf '\e[4 q' && export style=underline" 321 | [3]="eval printf '\e[1 q' && export style=block" 322 | [4]="exit_" 323 | ) 324 | 325 | ask "${options}" "${menu}" "cursor_dict" 326 | 327 | else 328 | printf '\e[6 q' 329 | style=bar 330 | fi 331 | 332 | # Set the style in termux properties 333 | sed -i "s/.*terminal-cursor-style.*/terminal-cursor-style = ${style}/" "${HOME}/.termux/termux.properties" 334 | 335 | # Change Blink Rate 336 | sed -i "s/.*terminal-cursor-blink-rate.*/terminal-cursor-blink-rate = 600/" "${HOME}/.termux/termux.properties" 337 | 338 | echo -e "${green}Done.${white}" 339 | } 340 | 341 | 342 | change_ui() { 343 | echo -e "\n7. Changing Colour and Font." 344 | 345 | local colors="colors.properties.dark_blue" 346 | 347 | if [[ $defaults -eq 0 ]]; then 348 | 349 | local ui_options="\n1. Set Dark Blue\n2. Set Light Blue" 350 | 351 | export ui_dict=( 352 | [1]="export colors=colors.properties.dark_blue" 353 | [2]="export colors=colors.properties.light_blue" 354 | ) 355 | 356 | clear 357 | ask "${ui_options}" "${green}UI Menu${white}" "ui_dict" 358 | fi 359 | 360 | curl -s -o "${HOME}/.termux/colors.properties" \ 361 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/.termux/"${colors}" 362 | 363 | wget -q -O "${HOME}/.termux/font.ttf" \ 364 | https://raw.githubusercontent.com/anonymousx97/termux-setup/main/.termux/MesloLGS_NF_Bold.ttf 365 | 366 | echo -e "\n${green}Applying Changes.${white}" 367 | 368 | termux-reload-settings 369 | 370 | echo -e "${green}Done.${white}" 371 | } 372 | 373 | 374 | exit_() { 375 | echo -e "${green}Exiting...${white}" 376 | exit 377 | } 378 | 379 | 380 | save_setup_sh() { 381 | [[ -f "${PATH}/setup-termux" ]] && return 0 382 | 383 | echo -e "\nSaving setup.sh for future use." 384 | 385 | echo -e \ 386 | '#!/bin/bash\nbash -c "$(curl -fsSL https://raw.githubusercontent.com/anonymousx97/termux-setup/main/setup.sh)"' \ 387 | > "${PATH}/setup-termux" 388 | 389 | chmod +x "${PATH}/setup-termux" 390 | 391 | echo -e "${green}Done\n${white}You can now use ${green}'setup-termux'${white} to get back to this menu." 392 | 393 | } 394 | 395 | start 396 | save_setup_sh 397 | --------------------------------------------------------------------------------