Related
Dear fellow Tasker fans,
I feel slightly stupid, but I can't seem to find a proper way to trigger a Task when there is no active application on the foreground...
isosika said:
Dear fellow Tasker fans,
I feel slightly stupid, but I can't seem to find a proper way to trigger a Task when there is no active application on the foreground...
Click to expand...
Click to collapse
on the definition of foreground, I assume that means 'being displayed'. In that case, what you are trying to achieve is to trigger tasks on home screen.
Try to flash window title variable to get its name. You can then use that for your trigger.
alienyd said:
on the definition of foreground, I assume that means 'being displayed'. In that case, what you are trying to achieve is to trigger tasks on home screen.
Try to flash window title variable to get its name. You can then use that for your trigger.
Click to expand...
Click to collapse
Thank you for help @alienyd. I am actually trying to create a Profile which sets screen time out to 15 seconds when phone is on it's back and no app is open/active.
Sent from my A0001 using Tapatalk
I want to use tasker to turn the screen off. Secure Settings > Lock Device forces me to use pin, which is not what I want, as I use a finger print scanner to wake my device. Shell > Input keyevent 26 does not work either, as I am not rooted (Huawei Mate 9 pro, doesn't seem to have a reliable root yet).
I have tried doing it with System > Send intent, but that seems to have no effect. I dont know if I am doing it wrong. I have also tried
Code:
terminal task
, with a code like this (and some variants of it), without success:
Code:
am start --user 0 -a android.intent.extra.KEY_EVENT --es KEYCODE_POWER ACTION_DOWN
I have also tinkered with
Code:
android.intent.action.SCREEN_OFF
...but with even less success.
Any ideas as how how I can get this to work? Either with terminal emulator or tasker send intent task?
I think you can't do that cause you're using your Fingerprint. That is a security future and Tasker can't bypass it. Don't nail me on it cause I am not sure. Maybe someone else can prove me wrong.
Sent from my ONEPLUS A3003 using Tapatalk
Maybe you could setup a workaround for this. For example, you could lower the display timeout value to one second so your device locks itself.
(Don't forget to change the timeout back to your preferred value after another second!)
digitalpig82 said:
Maybe you could setup a workaround for this. For example, you could lower the display timeout value to one second so your device locks itself.
(Don't forget to change the timeout back to your preferred value after another second!)
Click to expand...
Click to collapse
Good idea. But the minimum is 7 seconds, which is too long to wait, for the solution to be worthwhile.
I found a way to do it:
1: Create a task:
display > display timeout: 8 seconds
scene: Show scene: popup - display as overlay, blocking, full screen2: create a profile for screen on, create task:
hide scene: popup
display > display timeout: 30 seconds
So you're hiding the ui with a black screen until the screen is really switched off after 8 seconds, right? But what happens when you press the back or home button within the 8 seconds? Does the scene disappear?
This is what I do. Just make a task with Run shell, no need for security settings app. In the command line type input keyevent 26. You then can add a short cut when you double tap the homescreen to turn off the screen.
@snorrski you might want to have a look at this:
https://forum.xda-developers.com/u/...-adb-shell-t3562013/post72212441#post72212441
It seems to be exactly what you wanted. It works without root and on my (unrooted) S7 Edge, I can still use the fingerprint sensor to unlock my device after locking it this way (input keyevent POWER).
digitalpig82 said:
So you're hiding the ui with a black screen until the screen is really switched off after 8 seconds, right? But what happens when you press the back or home button within the 8 seconds? Does the scene disappear?
Click to expand...
Click to collapse
Yes, exactly. That's the way it is program.med for now.
digitalpig82 said:
@snorrski you might want to have a look at this:
https://forum.xda-developers.com/u/...-adb-shell-t3562013/post72212441#post72212441
It seems to be exactly what you wanted. It works without root and on my (unrooted) S7 Edge, I can still use the fingerprint sensor to unlock my device after locking it this way (input keyevent POWER).
Click to expand...
Click to collapse
Thank you! That does indeed look like what I need!
digitalpig82 said:
@snorrski you might want to have a look at this:
https://forum.xda-developers.com/u/...-adb-shell-t3562013/post72212441#post72212441
It seems to be exactly what you wanted. It works without root and on my (unrooted) S7 Edge, I can still use the fingerprint sensor to unlock my device after locking it this way (input keyevent POWER).
Click to expand...
Click to collapse
@snorrski
I know it's been over 2 years since y'all had this discussion, but I hope this still reaches you.
The power button on my Mi A1 stopped working recently and I can't seem to find it's replacement flex cable anywhere. I'm entirely new to Tasker but I have been reading for hours now to find ways to use a screen based interaction (say a double tap on the screen) to simulate the Power button to turn the screen off while still being able to unlock my phone with my fingerprint scanner.
So far, I've understood that it is doable (with an article refering to input keyevent 26), even more so on Android Pie (with another article refering to using Global_Actions) than it was previously possible, but am entirely clueless on how. I also couldn't quite understand the process of using the remote ADB shell plugin you mention here.
Could either of the two of you please share a step-by-step how-to on how to achieve the same? It would really help a lot. Thank you
Note: I'm using unrooted Mi A1 running stock Android Pie with July 1st security patch.
deepesh_p said:
@snorrski
I know it's been over 2 years since y'all had this discussion, but I hope this still reaches you.
The power button on my Mi A1 stopped working recently and I can't seem to find it's replacement flex cable anywhere. I'm entirely new to Tasker but I have been reading for hours now to find ways to use a screen based interaction (say a double tap on the screen) to simulate the Power button to turn the screen off while still being able to unlock my phone with my fingerprint scanner.
So far, I've understood that it is doable (with an article refering to input keyevent 26), even more so on Android Pie (with another article refering to using Global_Actions) than it was previously possible, but am entirely clueless on how. I also couldn't quite understand the process of using the remote ADB shell plugin you mention here.
Could either of the two of you please share a step-by-step how-to on how to achieve the same? It would really help a lot. Thank you
Note: I'm using unrooted Mi A1 running stock Android Pie with July 1st security patch.
Click to expand...
Click to collapse
Your post is getting long in the tooth. Are you still looking for help?
There are button remapping apps and apps that do double tap for off in the play store. Also, launchers can do this. Nova launcher for sure, but others I believe as well.
ktmom said:
Your post is getting long in the tooth. Are you still looking for help?
There are button remapping apps and apps that do double tap for off in the play store. Also, launchers can do this. Nova launcher for sure, but others I believe as well.
Click to expand...
Click to collapse
Hey, thanks for the suggestions. Gravity Screen, Nova Launcher as well as finally being able to understand Tasker, did help solve this issue, as I still look for a flex cable to fix the physical button issue as well.
deepesh_p said:
Hey, thanks for the suggestions. Gravity Screen, Nova Launcher as well as finally being able to understand Tasker, did help solve this issue, as I still look for a flex cable to fix the physical button issue as well.
Click to expand...
Click to collapse
Any chance this is what you're looking for?
https://www.cellspare.com/mi-a1-parts/xiaomi-mi-a1-side-key-flex-cable-module
ktmom said:
Any chance this is what you're looking for?
https://www.cellspare.com/mi-a1-parts/xiaomi-mi-a1-side-key-flex-cable-module
Click to expand...
Click to collapse
It is. Although, the price is 3.5x the price if I got it from an authorised Xiaomi service centre (except the one in my locality doesn't have it) and about 14x than what is available at local mobile spare parts shops (again not available). Hopefully, I'll find it soon.
deepesh_p said:
It is. Although, the price is 3.5x the price if I got it from an authorised Xiaomi service centre (except the one in my locality doesn't have it) and about 14x than what is available at local mobile spare parts shops (again not available). Hopefully, I'll find it soon.
Click to expand...
Click to collapse
https://www.ebay.com/itm/For-Xiaomi...851299?hash=item33fb43b7e3:g:BHEAAOSwfNpbM2Pn
https://www.parts4repair.com/side-key-flex-cable-for-xiaomi-mi-a1-5x/
Hi All,
It would appear that the interface / code changed rather a lot in the most recent update and the previous intents are no longer working.
I have figured out how to fix this. Please follow the directions below.
Important Note: Your profile name is now prefixed with PC. E.g. My profile of test.co.uk/example [user] would now be PC test.co.uk/example [user]
So, here are the settings (don't include the curly brackets):
Connect
Action: net.openvpn.openvpn.CONNECT
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME: PC {Your profile name}
Extra: net.openvpn.openvpn.AUTOCONNECT: true
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
Disconnect
Action: net.openvpn.openvpn.DISCONNECT
Extra: net.openvpn.openvpn.STOP: true
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
Edit: As of the current version (3.0.4), OpenVPN no longer remains in the foreground on disconnect.
Awesome... Thanks for the fix.
Sent from my Galaxy Note 8 using XDA Labs
Thanks
Yes - It is very annoying that OpenVPN remains on the foreground on Disconnect.
Can Tasker's Kill App be used for this purpose?
jvillasante said:
Yes - It is very annoying that OpenVPN remains on the foreground on Disconnect.
Can Tasker's Kill App be used for this purpose?
Click to expand...
Click to collapse
I tried this but it didn't seem to do anything.
mmotti said:
Hi All,
It would appear that the interface / code changed rather a lot in the most recent update and the previous intents are no longer working.
I have figured out how to fix this. Please follow the directions below.
Important Note: Your profile name is now prefixed with PC. E.g. My profile of test.co.uk/example [user] would now be PC test.co.uk/example [user]
So, here are the settings (don't include the curly brackets):
Connect
Action: net.openvpn.openvpn.CONNECT
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME: PC {Your profile name}
Extra: net.openvpn.openvpn.AUTOCONNECT: true
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
Disconnect
Action: net.openvpn.openvpn.DISCONNECT
Extra: net.openvpn.openvpn.STOP: true
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
Annoyingly they have made it so OpenVPN remains in the foreground on disconnect. I have yet to look into this.
Click to expand...
Click to collapse
Thank you very much!!!
mmotti said:
Annoyingly they have made it so OpenVPN remains in the foreground on disconnect. I have yet to look into this.
Click to expand...
Click to collapse
:highfive: Thank you for finding this. I had to downgrade 1.1.27 to get my task to work, but now I've got the new UI and working tasks, so THANK YOU.
As a lazy workaround to the app remaining in the foreground I've added a 1-second wait then 2 AutoInput Back actions:
"Intent to end OpenVPN connection"
2. Wait = 1 second
3. AutoInput Global Action = Back
4. AutoInput Global Action = Back
mondohow said:
:highfive: Thank you for finding this. I had to downgrade 1.1.27 to get my task to work, but now I've got the new UI and working tasks, so THANK YOU.
As a lazy workaround to the app remaining in the foreground I've added a 1-second wait then 2 AutoInput Back actions:
"Intent to end OpenVPN connection"
2. Wait = 1 second
3. AutoInput Global Action = Back
4. AutoInput Global Action = Back
Click to expand...
Click to collapse
Could you explain in tasker how to do it?
Thanks
xhenon said:
Could you explain in tasker how to do it?
Thanks
Click to expand...
Click to collapse
You will need the AutoInput Tasker plugin for this to work. You can get it from here:
https://play.google.com/store/apps/details?id=com.joaomgcd.autoinput
1. Follow the above steps for the Disconnect task
2. Hit the + to add a new action
In the list that pops up, select Task -> Wait and change it to 1 second
3. Hit the + button to add a new action
In the list select Plugin -> AutoInput -> Global Action
Hit the pencil icon next to Configuration
Hit Action -> Select Back from the list
Hit the check mark on the top right, then hit the back button to return to the Actions list
4. Repeat #3
Your Actions list should look like the attached image.
I had to add the AutoInput 'Back' action twice since OpenVpn Connect backs out of the VPN Profile screen into the main app screen. The second Back action takes you to back into your last app/activity.
It's a lazy workaround so I'm sure someone will come up with something better in time.
Go Home tasker task
As another workaround for OpenVPN Connect staying in the foreground on Disconnect I added this tasks to my disconnect profile
Wait 5 seconds
Go Home
Tasker has a Go Home task built in that effectively works for this use case!
jvillasante said:
As another workaround for OpenVPN Connect staying in the foreground on Disconnect I added this tasks to my disconnect profile
Wait 5 seconds
Go Home
Tasker has a Go Home task built in that effectively works for this use case!
Click to expand...
Click to collapse
Excellent - Thanks.
Thank you for this. BIG help.
I was wondering if anybody out there has a profile for disconnecting from OpenVPN but only after wifi has been in disconnected state for 30 seconds?
Thanks.
jvillasante said:
As another workaround for OpenVPN Connect staying in the foreground on Disconnect I added this tasks to my disconnect profile
Wait 5 seconds
Go Home
Tasker has a Go Home task built in that effectively works for this use case!
Click to expand...
Click to collapse
Thanks to the OP and thanks to you,excellent info
Thanks for sharing, i was quite annoyed by that update.
Made my day
Hi.
Thank you for this.
Maybe i am just to noobish for this, but how do you make the command "Actions"?
Is that Secure settings?
betahelix said:
Hi.
Thank you for this.
Maybe i am just to noobish for this, but how do you make the command "Actions"?
Is that Secure settings?
Click to expand...
Click to collapse
I originally followed a guide here: https://collinmbarrett.com/android-tasker-openvpn/
That should tell you where to find the necessary actions.
Use the updated values in OP instead of those listed on the site, though.
mmotti said:
I originally followed a guide here: https://collinmbarrett.com/android-tasker-openvpn/
That should tell you where to find the necessary actions.
Use the updated values in OP instead of those listed on the site, though.
Click to expand...
Click to collapse
First of all, thank you for this post.
Currently I'm using "go home" to "close" open vpn after disconnect.
Latest change log says "* added minimize app on disconnect shortcut feature"
Do you think we can use it in Tasker somehow to natively minimize the app after disconnect?
Sent from my Pixel 2 using Tapatalk
rodak said:
First of all, thank you for this post.
Currently I'm using "go home" to "close" open vpn after disconnect.
Latest change log says "* added minimize app on disconnect shortcut feature"
Do you think we can use it in Tasker somehow to natively minimize the app after disconnect?
Click to expand...
Click to collapse
I was using: wait 1 second and go home.
After updating, it actually closes itself automatically now. It happens very quickly - I don't even see the OpenVPN UI.
mmotti said:
I was using: wait 1 second and go home.
After updating, it actually closes itself automatically now. It happens very quickly - I don't even see the OpenVPN UI.
Click to expand...
Click to collapse
Thanks, will try it out.
Edit: It worked perfectly, maybe time to update the original post?
Sent from my Pixel 2 using Tapatalk
rodak said:
Thanks, will try it out.
Edit: It worked perfectly, maybe time to update the original post?
Click to expand...
Click to collapse
I popped an edit in there
mmotti said:
I popped an edit in there
Click to expand...
Click to collapse
Hello,
I am using Automate its pretty much the same in terms of use like tasker.
But it's free and you Programm flows. But when I try this without using the back back option the disconnect interface didn't close it self.
Did you comment something new in the action blocks?
Gesendet von meinem G8341 mit Tapatalk
Is it possible to use tasker to switch on lastpass accessibility toggle? My OnePlus 3t (not rooted, OOS 9.0.4) deactivates it almost on a daily basis. I have switched off battery optimisation for lastpass but the phone turns the toggle off.
Use auto input
Ta. I'll check that out
Hi there. Maybe you can try using the "Custom Setting" action for that. Try using the Magnifying glass in the action with the option to automatically find the setting and see if Tasker can find it. Hope this helps!
joaomgcd said:
Hi there. Maybe you can try using the "Custom Setting" action for that. Try using the Magnifying glass in the action with the option to automatically find the setting and see if Tasker can find it. Hope this helps!
Click to expand...
Click to collapse
I found that by googling but I can't figure out how to make it toggle the switch. The tasker forum talks about reading the accessibility setting but gives no more details than 'brilliant that works'
Eggstones said:
I found that by googling but I can't figure out how to make it toggle the switch. The tasker forum talks about reading the accessibility setting but gives no more details than 'brilliant that works'
Click to expand...
Click to collapse
The easy way is to use the Secure Settings action in AutoTools. That has a direct option for accessibility services. I plan on adding that option to Tasker directly at a later date.
With the Custom Setting action what you should do is read the value, remove or add the needed service from the list, the write the setting.
Ta I'll test that
joaomgcd said:
The easy way is to use the Secure Settings action in AutoTools. That has a direct option for accessibility services. I plan on adding that option to Tasker directly at a later date.
With the Custom Setting action what you should do is read the value, remove or add the needed service from the list, the write the setting.
Click to expand...
Click to collapse
I must be missing something here. Autoapps seems to only control a subscription service. Can't see anything called secure settings when I download it.
Eggstones said:
I must be missing something here. Autoapps seems to only control a subscription service. Can't see anything called secure settings when I download it.
Click to expand...
Click to collapse
I mentioned AutoTools, not AutoApps
joaomgcd said:
I mentioned AutoTools, not AutoApps
Click to expand...
Click to collapse
Mea culpa mea maxima culpa.
I'll try again.
I seem to have manage to get the change state to react to it switching state but need to do some adb to see if it works.
Deleted
joaomgcd said:
The easy way is to use the Secure Settings action in AutoTools. That has a direct option for accessibility services. I plan on adding that option to Tasker directly at a later date.
With the Custom Setting action what you should do is read the value, remove or add the needed service from the list, the write the setting.
Click to expand...
Click to collapse
I can now get the profile to switch on but I cannot figure out how to get the secure setting to change the toggle.
Both profile and task shows up as green but nothing seems to happen.
Eggstones said:
Mea culpa mea maxima culpa.
I'll try again.
I seem to have manage to get the change state to react to it switching state but need to do some adb to see if it works.
Click to expand...
Click to collapse
No problem at all Let me know how it goes!
joaomgcd said:
No problem at all Let me know how it goes!
Click to expand...
Click to collapse
Not well at all. The profile activates but nothing is actually changed.
Eggstones said:
Mea culpa mea maxima culpa.
I'll try again.
I seem to have manage to get the change state to react to it switching state but need to do some adb to see if it works.
Click to expand...
Click to collapse
Eggstones said:
Not well at all. The profile activates but nothing is actually changed.
Click to expand...
Click to collapse
Does it work if you run the task manually?
joaomgcd said:
Does it work if you run the task manually?
Click to expand...
Click to collapse
No. If I click on the task I don't get an error or the green dot. Instead I get a grey play arrow Infront of the task.
In the profile window both the profile and task shows up as green.
Eggstones said:
No. If I click on the task I don't get an error or the green dot. Instead I get a grey play arrow Infront of the task.
In the profile window both the profile and task shows up as green.
Click to expand...
Click to collapse
That means that Tasker doesn't seem to be able to communicate with AutoTools. Do other AutoTools actions work?
To make sure Tasker and the AutoApps run in the foreground please check here: https://tasker.joaoapps.com/userguide/en/faqs/faq-problem.html#00
joaomgcd said:
That means that Tasker doesn't seem to be able to communicate with AutoTools. Do other AutoTools actions work?
To make sure Tasker and the AutoApps run in the foreground please check here: https://tasker.joaoapps.com/userguide/en/faqs/faq-problem.html#00
Click to expand...
Click to collapse
Sorry to be a pain but I cannot find the run in foreground setting on my OnePlus 3t.
Eggstones said:
Sorry to be a pain but I cannot find the run in foreground setting on my OnePlus 3t.
Click to expand...
Click to collapse
Did you check here?
joaomgcd said:
Did you check here?
Click to expand...
Click to collapse
Yep. All those seeking are correctly set. It's the tasker foreground setting I cannot find. Tried googling it but the links I found doesn't match what I see in tasker.
Hi All, i'm not sure which system pacakage i disable, i'm not able to use split screen. Click on "Open in split screen view" but nothing happen.
hopefuly someone can enlightening me, i do not want to reset my phone. Thanks.
If you've been disabling system packages without knowing what they do then no wonder you have issues. Maybe provide a list of packages you did disable so we can try to work out if they would affect screen split. Otherwise we are just searching in the dark.
managed to solve it through restoring some of the packages i debloated earlier by using ADB AppControl. Split view is working now.
Which package did you restored, because I have the same problem?
tarantulapg said:
Which package did you restored, because I have the same problem?
Click to expand...
Click to collapse
narrow down and found the culprit is this: " com.samsung.android.app.appsedge "
kongming623 said:
narrow down and found the culprit is this: " com.samsung.android.app.appsedge "
Click to expand...
Click to collapse
Thank you my friend
kongming623 said:
narrow down and found the culprit is this: " com.samsung.android.app.appsedge "
Click to expand...
Click to collapse
I thought that app was for the edge panels. I'm surprised that would break split view. Just goes to show how far reaching some apps really are. Glad you sorted it.
richhaynes said:
I thought that app was for the edge panels. I'm surprised that would break split view. Just goes to show how far reaching some apps really are. Glad you sorted it.
Click to expand...
Click to collapse
That actually makes some sense because depending on which edge panel you enable it will only allow split view capable apps. which is a giant PITA for me. I hate split screen and have managed to disable it so I can use my panel as more like a quick launch bar....but i can only add split view capable apps to the bar.