├── README.md ├── boot-termux └── termux-url-opener /README.md: -------------------------------------------------------------------------------- 1 | # Termux-boot 2 | Executes all scripts in /data/data/com.termux/files/home/boot in separate termux-sessions, 5 minutes after boot. 3 | 4 | This code requires being rooted. 5 | For this to work the code in the boot-termux file must run on boot. If you have magisk, you can place the boot-termux script in /magisk/.core/service.d. Otherwise you will have to find out if any init scripts in the /etc directory of your phone are executed on boot, and append the boot-termux code to that. 6 | 7 | The termux-url-opener file must be placed in ~/bin/termux-url-opener (use chmod +x to make it executable). 8 | If you are already using termux-url-opener rename it to termux-url-opener-2 and all links that do not begin with TermuxLauncher.xyz will be redirected to it. 9 | 10 | 11 | To install from termux-url-opener : 12 | wget -P ~/bin https://github.com/DaBoss5/Termux-boot/raw/master/termux-url-opener 13 | chmod +x ~/bin/termux-url-opener 14 | 15 | To install boot-termux (for magisk users): 16 | wget -P /magisk/.core/service.d https://github.com/DaBoss5/Termux-boot/raw/master/boot-termux 17 | chmod +x /magisk/.core/service.d/boot-termux 18 | -------------------------------------------------------------------------------- /boot-termux: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | #The code sleeps for 5 minutes as the intent doesn't work immediately after boot. 4 | sleep 300 5 | am start -a android.intent.action.SEND --es android.intent.extra.TEXT TermuxLauncher.xyz -t text/plain com.termux 6 | -------------------------------------------------------------------------------- /termux-url-opener: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(echo $@ | awk '/^TermuxLauncher.xyz/')" != "" ] 4 | then 5 | if [ "$(echo $@ | sed -e 's/[^0-9]*//g')" == "" ] 6 | then 7 | for script in $(ls /data/data/com.termux/files/home/boot | nl | sed -e 's/[^0-9]*//g') 8 | do 9 | am start -a android.intent.action.SEND --es android.intent.extra.TEXT TermuxLauncher.xyz/$script -t text/plain com.termux 10 | done 11 | else 12 | script=$(ls /data/data/com.termux/files/home/boot | head -n$(echo $@ | sed -e 's/[^0-9]*//g') | tail -1) 13 | echo -ne "\033]0;$script\007" 14 | tsudo bash -c /data/data/com.termux/files/home/boot/"$script" 15 | bash 16 | fi 17 | else 18 | /data/data/com.termux/files/home/bin/termux-url-opener-2 "$@" 19 | fi 20 | --------------------------------------------------------------------------------