Quick Tile to keep screen on 2018-09-25

Sometimes you want to read something for a while on your device but the screen keeps turning off!

  1. joaomgcd
    Important: If you choose to import the project from the attached file, please run the Keep On task at least once so that the quick setting tile is set.

    You need at least Tasker version 5.4.6b for this profile to work (you might need to join the beta) and you can also directly import this profile from here.

    Ever had that annoying situation where you're trying to read an article on a website but the screen keeps wanting to turn off?

    You need to keep touching the screen just so it won't turn off and sometimes you even click a link by mistake and you get furious beyond belief?

    Well, this project's for you! :)

    With a simple tap you'll be able to keep your screen on for 10 minutes! After you're done, tap the icon again or simply turn off the display and it'll go back to your normal screen timeout!

    STEP 1 - CREATE BASIC TASK STRUCTURE


    • Create a new task and name it Keep On
    • Add an If action and set the Condition to %LastTimeout Is Set
    • Add Else and EndIf actions.
    (i) This task will be ran over and over when you click the quick tile icon, so we're going to toggle the %LastTimeout variable each time it runs and do different stuff depending on whether it's set or not


    STEP 2 - IF VARIABLE IS SET GO BACK TO NORMAL


    (i) If the variable is set, it means that you already set the screen timeout to a 10 minute value, so now we're returning stuff back to normal

    • Exit Tasker to save to previously created task
    • Enter it again and add a Setup Quick Setting action
    • Set Number to 2nd
    • Set Name to Keep On (which is the name of the current Task; this will make clicking the button run this task)
    • Set Status to Inactive
    • Accept and add a Display Timeout action
    • Set Secs to %LastTimeout (if you don't see the arrows icon, disable beginner mode in the Tasker settings)
    • Accept and add a Variable Clear action
    • Set Name to %LastTimeout
    • Move the actions added in this step to the If part of the task as shown in the video


    STEP 3 - IF VARIABLE IS NOT SET -> SET SCREEN TIMEOUT TO 10 MINUTES


    • Copy-Paste the Setup Quick Setting action from above and change the Status to Active
    • Add a Variable Set action and set %LastTimeout to the current display timeout (%DTOUT)
    • Add a Display Timeout action and set it to 10 minutes
    • Move the actions added in this step to the Else part of the task as shown in the video


    STEP 4 - FINISHING TOUCHES AND TESTING


    • At the end of the task add a Flash action with the text Your screen will be on for %DTOUT seconds just to see if the display timeout value was set correctly
    • Run the task multiple times to check if the screen timeout value toggles correctly between 10 minutes and your normal value
    • Exit Tasker to save
    • Add the 2nd Tasker Quick Setting tile to your tile list
    • Tap it a few times to confirm that the task is working
    • Set the tasks icon to an appropriate one, so that it looks better in your quick tile settings
    • Notice how the icon goes gray and black appropriately depending on the situation


    STEP 5 - GO BACK TO NORMAL WHEN SCREEN TURNS OFF


    • Add a profile in Tasker
    • Add the Display Off event
    • As the task select the Keep On task
    • Add a Variable Value state condition to the profile
    • Set the condition to %LastTimeout is set
    • Name the profile Go Back To Normal When Screen Off
    (i) This will make sure that when the screen is off (whether you forgot it on and it timed out after 10 minutes, or if you turned it off manually), the time out setting goes back to normal. :cool: