Comments (8)
+1 from me
I use the plugin with automate and the only way currently to get things back is via broadcast or external file which works but is quite annoying to set up.
from termux-tasker.
Oh, agreed!
The ability to allow returning data from Termux into Tasker would mean that you can do things like tell if your scripts actually succeed, let you get processed data directly into Tasker tasks, or return state that only Termux can see.
So this comment isn't basically just a "+1", I'll try to explain the impact this has; without this functionality, the ways to return data to Tasker involve either:
Writing files to Tasker-readable locations
Since it's easier to explain by showing what things look like practically, let's dive into creating a scene with three checkboxes that are set with simple checks in Termux!
First, to get the status of each service, you need to either write a new script, or add a hack to an existing script to write to a folder that Tasker can read. In this case I opted for a hack in my service script.
Then after implementing that, in order to read the result, the Task itself needs to perform the checks for each file (Easier in this case), or extract all the data from one file:
The end result is, voila! I have 3 checkboxes on this scene that are checked based on if a service is started or not!
So, while it's not impossible, the ability to read the status code of tasks would be a really welcome for situations like this.
Sending an intent
This requires setting up a new Tasker profile for every single variable you wish to pass back that you wish to do something based on. So if I wanted to create a Task that ran a command, and if the result matched something to run another Task, that would involve:
- Setting up the Task to run the script
- Writing the script which would do the check, and then run the shell command:
am broadcast --user 0 -a net.dinglish.tasker.the-thing-I-want-to-send -e message "$something"
- Make a Tasker profile to react to the
net.dinglish.tasker.the-thing-I-want-to-send
intent and set it to a global variable, or to do the rest of the Task started in the Task started in Step 1
You would need to do this for every single communication between Tasker and Termux--so for something with 5 checks, that would involve making at least 6 profiles that do nothing but react to intents to continue your logic.
So again, while this is not impossible, it takes a pretty reasonable amount of extra effort.
Anyway, hope this explains what we are up against here..! I think this suggestion would be highly appreciated, so I wrote this up in hopes to give it a little more than just a simple "me too".
But even if this suggestion is declined, thanks for the project! It's extraordinarily useful~
from termux-tasker.
Yays! I'm happy I could help~
from termux-tasker.
I concur on the usefulness of this request.
from termux-tasker.
I am glad other people need it too..
I hope the creators of Termux will notice this thread, and update the Termux Tasker plugin..
from termux-tasker.
Hm, looking into it, it seems like adding this requires a bit more work than just updating this plugin.
Specifically, it looks like it requires an update in the main app to return those three values from the Service that handles the Intent here.
I'm not really an Android dev, so I'm not sure about the best way to do that.
from termux-tasker.
I look forward to seeing Archenoth's PRs merged! I started offloading more complex Tasker logic to Termux, and it is becoming apparent how much this feature is needed.
from termux-tasker.
The PR of @Archenoth (great job!) has been merged and released in version 0.4 of the Termux:Tasker app.
Note that this also requires version 0.86 of the main Termux app - this will be released within a day.
from termux-tasker.
Related Issues (20)
- Is the development of this plugin stopped? I can't install in on Android 14 HOT 1
- bash: extglob off in the plugin - not possible to enable it HOT 4
- Run scripts from the location they are saved in, instead of the destination of the softlink. HOT 3
- The argument not support file paths HOT 2
- App package conflicting HOT 1
- Cannot install: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE] HOT 4
- change request: make com.termux.permission.RUN_COMMAND permission enforcement optional HOT 3
- Error installing Termux Tasker HOT 1
- I can't install this app on my Android HOT 1
- stdout not working with Tasker HOT 9
- Installation issue HOT 1
- httpie binary doesn't work in background HOT 9
- My script output dissappears immediately after running HOT 2
- Working directory doesn't seem to work if there are spaces in the name
- Actions downloads expired HOT 1
- "other plugin host apps"? HOT 1
- Readme unclear HOT 2
- Script not found HOT 9
- bash - "Arguments" doesn't accept bash commands HOT 3
- App icon stay showed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termux-tasker.