Giter Site home page Giter Site logo

Comments (34)

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024 1

If you are running in background, it should continue when your script completes. If you are running in terminal session, then on version 0.4, it would likely not continue because the plugin never sends RESULT_CODE_OK back to tasker and tasker waits forever.

That has been solved in version 0.5. Check number 9 in Issue 36 for details.

from termux-tasker.

zhdenny avatar zhdenny commented on July 4, 2024

+1

from termux-tasker.

Archenoth avatar Archenoth commented on July 4, 2024

Oh! I guess I should probably mention in here that you can continue tasks immediately now! (Though not with a checkbox)

Currently, you can continue tasks immediately by dragging the timeout slider all the way to the left to "None".
"Timeout (Seconds)" slider in Tasker configuration set to "None" (all the way left)

Any other value will wait that long for a result before timing out.

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

This was solved in version 0.4 or likely would have been possible even before with the timeout value None and should be closed.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Hi All

I think the original purpose of this issue was not quite understood.

Sometimes we need to perform a Task, but we don't know how long it will take.
For example Compressing a big folder.
And we need to wait for the Task to end, before we continue with the other actions.

So setting a predefined Timeout to wait, is not good,
because if you set 10secs, and the opertion took 12secs, then your execution will be broken.

So what we need is a "Wait for Task to End" Checkbox.

The reason I name this checkbox "Continue Task Immediately", was just for consistency reasons with other Tasker actions.
In other tasker actions that have this checkbox, Unsetting it, causes the action to Wait till it finishes, before it continues to the next action.

But I clearly see now how confusing it is.

So allow me to rephrase:
Can you please add a Checkbox "Wait for Task to End"?

I need this not because I want to continue the task immediately,
but the opposite: I want the execution to wait for the task to end..

Thank you

from termux-tasker.

Archenoth avatar Archenoth commented on July 4, 2024

Oh, don't worry! That's also addressed~ ^^

Basically, if you don't know how long a task will take, you can drag this all the way to "Never" and it will never timeout
Screenshot of termux-tasker for a backup.sh command, with the Timeout slider set to "never" at the far right

Basically, instead of a checkbox, it's just using the slider already in Tasker; and the two extremes of that slider are the functionality I think this issue was asking for in checkbox-form.

(Or is there something else that you were hoping to do..?)

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Oh +_+

Was not aware about the other extreme..

Thank you, will update my code now

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

I checked it now,
and it seems that setting the Timeout to Never does not continue past the current action..
Is it like that for other people too?

from termux-tasker.

Archenoth avatar Archenoth commented on July 4, 2024

I checked it now,
and it seems that setting the Timeout to Never does not continue past the current action..
Is it like that for other people too?

Oh, it should continue after the command returns

Like, if you symlink something like sleep into ~/.termux/tasker, and make a task that runs "sleep 5" with a timeout of "never" followed by flashing some text onto the screen, that flash should happen after the sleep returns.

Is it not doing that for you?

Here's some Tasker XML you can import to test the above (After making the symlink)
I just tested this locally and it appears to work.

<TaskerData sr="" dvi="1" tv="5.10.1">
	<Task sr="task124">
		<cdate>1608106054217</cdate>
		<edate>1608106062459</edate>
		<id>124</id>
		<nme>Test Termux Sleep</nme>
		<Action sr="act0" ve="7">
			<code>1256900802</code>
			<Bundle sr="arg0">
				<Vals sr="val">
					<com.termux.execute.arguments>5</com.termux.execute.arguments>
					<com.termux.execute.arguments-type>java.lang.String</com.termux.execute.arguments-type>
					<com.termux.tasker.extra.EXECUTABLE>sleep</com.termux.tasker.extra.EXECUTABLE>
					<com.termux.tasker.extra.EXECUTABLE-type>java.lang.String</com.termux.tasker.extra.EXECUTABLE-type>
					<com.termux.tasker.extra.TERMINAL>false</com.termux.tasker.extra.TERMINAL>
					<com.termux.tasker.extra.TERMINAL-type>java.lang.Boolean</com.termux.tasker.extra.TERMINAL-type>
					<com.termux.tasker.extra.VERSION_CODE>4</com.termux.tasker.extra.VERSION_CODE>
					<com.termux.tasker.extra.VERSION_CODE-type>java.lang.Integer</com.termux.tasker.extra.VERSION_CODE-type>
					<com.twofortyfouram.locale.intent.extra.BLURB>Execute ~/.termux/tasker/sleep 5</com.twofortyfouram.locale.intent.extra.BLURB>
					<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%stdout
Standard Output
The &amp;lt;B&amp;gt;output&amp;lt;/B&amp;gt; of running the command&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;%stderr
Standard Error
The &amp;lt;B&amp;gt;error output&amp;lt;/B&amp;gt; of running the command&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;%result
Exit Code
The exit code set by the command upon completion.
0 often means success and anything else is usually a failure of some sort&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
					<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
					<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>com.termux.tasker.extra.EXECUTABLE com.termux.execute.arguments</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
					<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
					<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
					<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
				</Vals>
			</Bundle>
			<Str sr="arg1" ve="3">com.termux.tasker</Str>
			<Str sr="arg2" ve="3">com.termux.tasker.EditConfigurationActivity</Str>
			<Int sr="arg3" val="3600"/>
		</Action>
		<Action sr="act1" ve="7">
			<code>548</code>
			<Str sr="arg0" ve="3">Ahh</Str>
			<Int sr="arg1" val="0"/>
		</Action>
	</Task>
</TaskerData>

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

If you are running in background, it should continue when your script completes.
If you are running in terminal session, then on version 0.4, it would likely not continue because the plugin never sends RESULT_CODE_OK back to tasker and tasker waits forever.

I am running in terminal session, because I want to see the progress of the execution..

That has been solved in version 0.5. Check number 9 in Issue 36 for details.
Seems that v0.5 is "F-Droid only"..

MY Tasker and all Tasker plugins (in.c Termux Tasker) is downloaded from Google Play..
Any special reason why it's not on Google Play too?
(I prefer to update from there)

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Oops..

The "Seems that v0.5 is "F-Droid only" line should not be quoted..
I wrote it..

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

Check the reddit post here for why F-Droid only and how to shift.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Oh..
Didn't know that..

Hmm,
I am not so keen to shift all my Termux Plugins to F-Droid,
so I guess I will stay with a longer timeout value for now.

BTW, is this F-Droid shift only for Termux Plugins, or also for the Termux app itself too?

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

I am running in terminal session, because I want to see the progress of the execution.

Moreover, if you are running commands in the foreground, you will not receive any results back and in version 0.5, the task will continue immediately, regardless of timeout value.

If you want the task to wait until the foreground session is closed, that may or may not be possible, at least easily. Execution is handled by the TermuxService in termux-app, so fix will need to be done there. That will also require reverting number 9 behaviour of sending RESULT_CODE_OK back immediately regardless of timeout for foreground commands. I may look into it, but can't commit time.

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

This is for all termux apps and updates have already been pushed to F-Droid for termux-app that are not available on play store. It would be advisable that you do shift for bug fixes and improvements.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Oh
That explains why I didn't see Termux being updated lately.. ;)

OK Thank you very much for this info

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

You are welcome.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Archenoth, thank you for the code.. @->-

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

I second that as well for bringing result variables. Thanks.

from termux-tasker.

Archenoth avatar Archenoth commented on July 4, 2024

Oh! Thank you!

But the improvements that @agnostic-apollo made in 0.5 seem to cover a lot of ground I didn't (And are actually just excellent in general! So thank you for that as well~ ^^)

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

Wow, much praise. Thanks! And you are very welcome! :)

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

OK, big hug to agnostic-apollo as well :)

BTW, is there a chance maybe many users don't know about this whole F-Droid shift?

Maybe a message should have been pushed to all Termux users about this..
Because not everyone are on Github/Reddit

from termux-tasker.

 avatar commented on July 4, 2024

Maybe a message should have been pushed to all Termux users about this

What I can do only is to post information on Reddit and remove Play Store links from all READMEs and Termux Wiki. Adding that into motd would be overkill, but is possible too.

Broadcasting a message directly into every Termux installation is not possible.

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

OK, big hug to agnostic-apollo as well :)

Thanks a lot @spaceman5 :)

Maybe a message should have been pushed to all Termux users about this..
Because not everyone are on Github/Reddit

"Unfortunately", Termux does not gather telemetry data (that I know off) on users so that they could be sent private messages for situations like these. :p

Normally, Play Store app description can be updated without an update, not sure if that is possible with the targetSdkVersion issue. Although, that would require fornwall to do it since he is the one who has access.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Broadcasting a message directly into every Termux installation is not possible.
It is possible, using a small trick..

You guys can release a new version on Google Play (only on Google Play), that will include this message..

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Again a line that I wrote was included inside the quoted text..

"It is possible, using a small trick.." was written by me, and is not a part of the quote..
Sorry, I should separate the quoted text and my text with an empty line

from termux-tasker.

agnostic-apollo avatar agnostic-apollo commented on July 4, 2024

Releasing a new version "normally" would require incrementing the targetSdkVersion version which would then break the app for everybody on android 10+, there is a reason an upgrade is not being released.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Oh..

BTW,
did the developers consider meeting with google?

Termux is an app with a huge user base.
According to Google Play it's "10,000,000+".
This "+" doesn't say if it's 11 Millionm users, or 30 Millionm users..
But in any case, an app with such a huge user base, can expect to meet google, when having a developer problem which is so critical to the app's existence.

I highly recommend that Fredrik Fornwall (and amybe the other developers) ask google for this meeting with their engineers.

IMHO, the way to solve this problem is not to live with the google limitations, but to ask to break them, on a single app basis, due to necessity..
(and in order to keep Termux on google Play)

What do you think?

from termux-tasker.

 avatar commented on July 4, 2024

You guys can release a new version on Google Play (only on Google Play)

Nothing could be released or edited on Play Store. No one except Fornwall has access to it.

I highly recommend that Fredrik Fornwall (and amybe the other developers) ask google for this meeting with their engineers.

Fornwall is most likely out of project. No progress/information from him so far regaring Android 10.

We already has a solution in https://github.com/termux/termux-app/tree/android-10 but it will not be developed further as soon as termux-app will not have a new maintainer.

a huge user base, can expect to meet google, when having a developer problem

When developer uses legacy APIs, not provided by SDK or develops application in unexpected way and suddenly used functionality has been removed, that's not a problem of operating system. Developer is given a number of official APIs and application development guidelines which will ensure that application will run in long term.

Termux has not been designed with keeping in mind that one day execve for data files will not be allowed. However it has been warned about the issue on early stage but everyone has gracefully ignored warning considering it as "fake" and not possible.

Android Is Not Linux and no need to complain about that.

the way to solve this problem is not to live with the google limitations

These "limits" are from unexperienced user's scope.

From my scope, there are no limits. Just enforcing app to be built as it should. Application may not change itself and I agree with that. Please understand the difference between application (Termux) and OS (say Ubuntu or other Linux distro). Application should not be able to download executables from third-parties whereas operating system should be able to do so on user request.

Claiming that Google prohibits command line programs - that's unsubstantiated conspiracy and nonsense.

from termux-tasker.

spaceman5 avatar spaceman5 commented on July 4, 2024

Hi Xeffyr, thank you very much for your answer.

Just enforcing app to be built as it should.

I understand that.

But Termux is not a regular app,
it is like an OS, wrapped as an app.

For this reason, having this app be able to use execve(), is critical.
If Termux was a Contacts app, or a game, then of course the story would've been different.

The concept of a special app getting special permission by google is not new.
There is the "Device Admins" permission (which Tasker got, for example, since it's a mini development environment),
and there are many other examples.

If google want to enable Termux to continue, google can easily do so, by granting Termux the needed permissions.
(or by even creating a special permission for that)
The only question, is if google thinks having Linux on your phone, is important and useful, and If they want to support that, under Android.

I cannot explain how important and useful Termux was for me.
For years I wanted to learn Linux Command Line, but it was put aside and postponed, in the hope that I one day buy a Linux Laptop or small Mini-PC.
And with Termux, it finally happened.
That's what made me finally dive into linux, and thanks to it I also use Linux VPSes, and other linux devices now (such as RPi).

Give a person a computer, and he'll learn computers..
So in this case you give many persons a computer with Linux, on their phone..
And they learn Linux.
I see how really imporant and useful it is for one person (me), so multiply this by "10M+" persons,
and this definitely deserves a thought by google.

Fornwall is most likely out of project. No progress/information from him so far regaring Android 10.

Wow, that's really sad :(

I assume this happened after (and because of) the SDK issue?

If yes, maybe if it is solved with google, he might come back..

I find it hard to believe that someone who invested so much in it, would have any other reason to leave it,
toher than due to seeing it being killed by google, meaning it's futile to continue.

To summarize:

  1. Termux is not just an app, it's an OS wrapped as an app.
  2. Due to this, Termux needs more permissions than a regular app, such as the execve() function.
  3. Google can easily give this to Termux app, if they decide to.
    so now the only thing missing is communication with google engineers.

Please consider this path..

from termux-tasker.

 avatar commented on July 4, 2024

having this app be able to use execve()

Since SDK 29, execve() is possible only in JNI library dir - a place for native code. That restriction is reasonable and in general had to be implemented at same time when APK format has been created.

Termux is not just an app, it's an OS wrapped as an app.

Package manager do not give an operating system status to terminal emulator application.

Any shell can modify its PATH and use whatever binaries which can be executed by underlying OS. Set of binaries is called userspace or userland, but not operating system.

Due to this, Termux needs more permissions than a regular app, such as the execve() function.

Ohh, with SELinux is not that easy. SELinux cannot be bypassed through app permissions as works on very deep level.

Google can easily give this to Termux app

Nope. Here is what is needed to grant Termux execve() permission:

  1. Grant Termux application special status within the Android operating system.
  2. Create a separate SELinux domain which would apply for Termux app.
  3. Create an update for Android OS and enforce ALL (!!!) manufacturers to update their devices running Android 10 or higher.

That won't happen definitely. Termux is not backed by Google or any serious organization which will ensure that OS component candidate will not be outdated. Furthermore, it is not a mission critical thing.

Termux is not suitable to be an OS component and current status of Termux app shows that.

from termux-tasker.

 avatar commented on July 4, 2024

Locking issue since this is not a place to complain about Google's decisions.

from termux-tasker.

Grimler91 avatar Grimler91 commented on July 4, 2024

I assume this happened after (and because of) the SDK issue?

If yes, maybe if it is solved with google, he might come back..

I find it hard to believe that someone who invested so much in it, would have any other reason to leave it,

He is occupied with other personal matters, I am pretty sure the whole android 10 situation has nothing to do with his decision to re-prioritize how he spends his spare time.

from termux-tasker.

fornwall avatar fornwall commented on July 4, 2024

Sorry for being away and non responsive. Just got other things in life (mainly, new job and my second daughter) that have been taking a lot of energy. I'm actually starting (a nice and long 😊) Christmas vacation now, and is feeling motivated to jump back in!

I would encourage everyone wanting to contribute to join the chat at https://gitter.im/termux/dev !

from termux-tasker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.