Trigger: Screen Unlocked

Revision as of 21:48, 6 January 2026 by MacroDroidDev (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This trigger will fire when the screen is unlocked. It detects when the user successfully unlocks the device, whether by PIN, pattern, fingerprint, face recognition, or any other unlock method.

Options

This trigger has no configurable options. It simply fires whenever the device is unlocked by the user.

Examples

Example 1: Welcome message

Display a greeting when you unlock your phone:

Triggers

Screen Unlocked
Actions

Speak Text: "Hello, welcome back"

Example 2: Work mode activation

Enable work profile and settings when unlocking during work hours:

Triggers

Screen Unlocked
Actions

Set Ringer Volume: Vibrate
WiFi: Enable
Launch Application: Slack
Constraints

Time of Day: 9:00 AM - 5:00 PM
Day of Week: Monday - Friday

Example 3: Security logging

Log all device unlock events for security monitoring:

Triggers

Screen Unlocked
Actions

Log to file: "Device unlocked at [date] [hour]:[minute]:[second]"
Set Variable: [unlock_count] = [unlock_count] + 1

Notes

  • This trigger uses the Android ACTION_USER_PRESENT intent to detect when the user has unlocked the device
  • The trigger fires after the user has successfully passed the lock screen, not when the screen simply turns on
  • If no lock screen security is configured, this trigger fires immediately when the screen turns on
  • For actions that should run when the screen turns on (before unlock), use the Screen On trigger instead
  • A static counter is maintained internally to optimize resource usage when multiple macros use this trigger

See Also