Action based on "time since screen was touched"?

1,422 views
Skip to first unread message

Andrew Kantor

unread,
Jan 5, 2012, 4:16:19 PM1/5/12
to tas...@googlegroups.com
This is probably a noob question, but I haven't found an answer, so apologies if it's obvious to everyone....

I'd like to create an action that occurs whenever X amount of time has passed since the screen was last touched. Heck, it can be broader than that -- 'since any kind of user input.' Specifically, I'd like to dim the screen down to 20% when I haven't touched it for, say, five minutes -- and then go back to the previous brightness level as soon as I tap the screen.

The built-in screen timeout obviously requires me to press a hardware button to wake it. I'm willing to sacrifice a completely dark screen (20% will be OK) for the ability to 'wake' it with a simple touch.

Is this possible? I looked through the lists of events, but none seemed to be a simple "screen touched" or "button pressed." Is it possible to create the kind of task I want?

Thanks for any help, and apologies again if this has been asked and answered.

Pent

unread,
Jan 5, 2012, 5:16:09 PM1/5/12
to Tasker
> I'd like to create an action that occurs whenever X amount of time has
> passed since the screen was last touched.

Sorry, it's something that annoys me that Android doesn't make the
idle timer available to apps.

Pent

BradM

unread,
Jan 5, 2012, 5:43:14 PM1/5/12
to tas...@googlegroups.com
Check into Screebl. It has a stillness timer and stillness sensitivity option. The pro version has a Tasker plug-in.

UncleMike

unread,
Jan 8, 2012, 1:56:25 PM1/8/12
to tas...@googlegroups.com
My kids tend to leave their phones laying around a bit, and I wanted to have the phone's location automatically reported to me after a period of inactivity.  Here's something similar to what I did, that might work for you:

Named Task: Inactivity Timer
Variable Clear %DIMSCREEN
Wait 5 minutes
Variable Set %DIMSCREEN = 1
Note: Collision handling must be set to Abort Existing Task

Profile: Dim Screen
Context: Variable Value %DIMSCREEN Is Set
Enter Task:
Auto Brightness Off
Display Brightness 50

Profile:
Context: Display Unlocked
Task: Inactivity Timer

Profile:
Context: Button Widget Clicked (leave default settings)
Task: Inactivity Timer

Profile:
Context: New Window (leave default settings)
Task: Inactivity Timer


Each time the display is unlocked, a button is pressed, or a new window appears, the Inactivity Timer task is executed - aborting the existing timer (if it's still running), clearing the %DIMSCREEN variable, and waiting 5 minutes before setting the %DIMSCREEN variable to a value (the value doesn't matter, as long as the variable is set the something).

If the 5 minute timer expires, the %DIMSCREEN variable is set, causing the Dim Screen profile to activate - turning off auto brightness and setting the display brightness.  Any activity (unlocking the display, pressing a button, or displaying a new window) will start the inactivity timer - clearing the %DIMSCREEN variable, causing the Dim Screen profile to deactivate and return the screen brightness to it's previous settings.

I don't think this will "wake up" the device with a simple tap of the screen (absent pressing a button), but it might be possible to use the new Scene functionality to make a full-screen scene that will respond to a tap anywhere on the screen, and then hide itself.  I didn't have time to work with the 1.2 beta, so I'm trying to get up to speed on the whole scene thing.

Andrew Kantor

unread,
Jan 9, 2012, 4:59:24 PM1/9/12
to tas...@googlegroups.com
Excellent, and will do -- many thanks for the suggestion!

Andrew Kantor

unread,
Jan 10, 2012, 7:09:14 PM1/10/12
to tas...@googlegroups.com
Thank you for this -- I'll give it a shot next time I know I'll have 10 minutes to myself. It sounds pretty close to what I want, which I may just have to settle for.

brandall

unread,
Jan 10, 2012, 7:28:52 PM1/10/12
to Tasker
> Sorry, it's something that annoys me that Android doesn't make the
> idle timer available to apps.

You can grab it using a run shell action - I don't think you need to
be rooted?

toolbox uptime | awk '{print $4,$5,$6}' > /mnt/sdcard/idletime.txt

You could split the output in Tasker after you've used the 'read line'
function.

Not sure how you'd go about monitoring it from there though? - Could
easily use more resource than you'd save...

Message has been deleted

Murz

unread,
Jan 4, 2014, 6:43:06 PM1/4/14
to tas...@googlegroups.com
Android idle time via tasker will be very useful feature for me too. If Android don't have build-in 'idle time' reporting, you can easily emulate it: start timer and resets it to zero after each screen touch or button press, and launch event after timer goes greater that specific value.

Can you add this idle timer emulation to Tasker or maybe via plugin or separate app?

пятница, 6 января 2012 г., 2:16:09 UTC+4 пользователь Pent написал:

saha...@gmail.com

unread,
Aug 3, 2015, 1:46:40 AM8/3/15
to Tasker
kindly send full script step by step , i am new person , its help for me !!!!

i am set your procedure ,nothig 

Dale Smith

unread,
Aug 4, 2015, 1:08:27 AM8/4/15
to Tasker
I tried brandell's uptime script but piping to awk didn't work. It could be that he has awk on his phone and I don't. I doubt awk is installed on any Android phones. How many people even know what awk is or how to use it?

Sahab Deen

unread,
Aug 4, 2015, 10:10:35 AM8/4/15
to tas...@googlegroups.com
I don't know , friend . if you know ,explain it.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Tasker" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tasker/UW-jhGOjskU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tasker+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/tasker.
> For more options, visit https://groups.google.com/d/optout.
>
Reply all
Reply to author
Forward
0 new messages