6

I'd like to be able to detect a locked screen in Tasker without polling.

https://www.reddit.com/r/tasker/comments/3y3kpx/how_to_query_tasker_if_the_screen_is_locked_or_not/ has a solution that polls.

1 Answer 1

7

Create a profile Screen Locked triggered on the event Display Off and calling a task that sets a variable %SCREEN_LOCKED to true iff %SCREEN is off.

Create another profile Screen Unlocked triggered on the event Display Unlocked and calling a task that sets %SCREEN_LOCKED to false.

If you'd like for a profile to be triggered (or not) if the screen is locked: Create a third profile Display Locked triggered on %SCREEN_LOCKED being true and calling some NoOp task (which does pretty much nothing) then use the Profile Active trigger on the profile conditional on screen lock state.

2
  • Why do you need to check iff %SCREEN is off? Commented Feb 9, 2022 at 14:02
  • I forgot why that condition is there. Try it without it. Commented Feb 15, 2022 at 23:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.