How do I use Tasker to perform a command in Termux?

1,006 views
Skip to first unread message

Judah Richardson

unread,
Dec 21, 2017, 8:42:42 PM12/21/17
to Tasker

Termux can execute shell commands Tasker chokes on. Ergo, I need some way to execute a shell command in Termux from Tasker.


So far I've tried:

Per the app, you're supposed to set up a ~/.termux/tasker/ folder. Does anyone know how to do this on a non-root device? I can't figure out how, and the app exits if the folder isn't detected 🤦‍♂️ I suspect it's impossible without rooting.

My plan here was to have Tasker launch Termux, and then have AutoInput write the command into Termux. So I set up a task whose configuration is:


Test (4) 
A1: Launch App [ App:Termux Data: Exclude From Recent Apps:Off Always Start New Copy:Off ] 
A2: AutoInput Action [ Configuration:Type: Focus Text to Write : find /sdcard/Pictures -type f -exec mv --backup=numbered {} /sdcard/Sync ';' 
Action : Write Timeout (Seconds):20 Continue Task After Error:On ] 

The only thing the above does successfully is open Termux. After that, literally nothing happens. I've pretty much spent all day on this problem Googling and whatnot with no solution in sight. Any ideas?

Dale Smith

unread,
Dec 22, 2017, 1:47:22 PM12/22/17
to Tasker
Have you checked the Tasker permissions area for Storage permission? Also check your settings accessibility for Tasker on.

Judah Richardson

unread,
Dec 22, 2017, 2:42:51 PM12/22/17
to Tasker
Yeah I that's the 1st thing I checked. The limitation seems to be the Android shell itself, which is only quite minimal. The same commands also fail in Automate, Solid Explorer, and Fx File Explorer. I've since been able to use Termux:Task with coreutils installed in Termux to get what I needed done.

Dale Smith

unread,
Dec 23, 2017, 5:16:35 AM12/23/17
to Tasker
I looked at Termux Task on the play store. Looks interesting. What's coreutils. You were trying to delete a folder correct? What was the final command line in the action that you used? rmdir (folder name)?
Reply all
Reply to author
Forward
0 new messages