5

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.

Noel Yap
  • 211
  • 2
  • 7

1 Answers1

6

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.

Noel Yap
  • 211
  • 2
  • 7