by Jason Ervin
Version 1 (August 17, 2022)
Download (159 downloads)
๐ขThis flow starts a termux session and runs a command.
โด๏ธDEFAULTS:
To easily setup Termux from a clean install, run the setup flow. If there is an error with the update, use "pkg upgrade -y" in the first variable.
The defaults show off a very smooth setup process with good examples of how Termux can be utilized from AutoMate, without the use of the tasker plugin. Almost every part of the flow is extremely reusable. I have also shown 2 ways of inputting commands and arguments to Termux. I prefer the method in the setup flow, since it can be used to pass entire scripts to Termux.
The default command is the yt-dlp (youtube-dlp) command, which takes a URL to a YouTube video, downloads the video, and extracts the audio at the best possible quality in "flac" format. The default URL is for the song "Opiateยฒ" by Tool.
The default music_folder is set to a folder named "Music" on an SD card. You can change that path to any editable storage location. The path itself is specified via a relative path from the home folder to avoid any inconsistencies in SD card naming. For this to work, the termux-setup-storage command must have been run in advance.
โด๏ธAny command can be specified instead of yt-dlp.
๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป๐ป
โREQUIREMENTS:
โข Latest version of Termux from F-Droid
โข allow-external-apps permission set to true:
echo "allow-external-apps = true" >> ~/.termux/termux.properties
termux-reload-settings
โข "Run commands in Termux environment" permission set to true in automate permissions
โข display over other apps turned on for termux
๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ๐บ
๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ
โOPTIONAL (required for default code, covered in setup flow):
โข yt-dlp:
pkg upgrade
pkg install python ffmpeg
pip install yt-dlp
โข storage access:
termux-setup-storage
๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ๐ธ
๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น
โPOSSIBLE REQUIREMENTS:
โข battery saver turned off for termux
๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น๐น
โค๏ธHuge thanks to Micha on discord (leaving out the full tag for their privacy) for helping me figure out the syntax on the start service block
(PS paste the contents of the clipboard set block after the args in the run service block to run the command in the background. Not recommended if you want to be able to see the progress or results of the command)
5 stars | 0 | |
4 stars | 0 | |
3 stars | 0 | |
2 stars | 0 | |
1 star | 0 | |
Reports | 2 |
Rate and review within the app in the Community section.