Difference between revisions of "Trigger: Screen Unlocked"

(Created page with "This trigger will fire when the screen is unlocked.")
 
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This trigger will fire when the screen is unlocked.
+
<pre class="header-style">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.</pre>
 +
 
 +
''' 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:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen Unlocked</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Speak Text: "Hello, welcome back"</pre>
 +
 
 +
'''Example 2: Work mode activation'''
 +
 
 +
Enable work profile and settings when unlocking during work hours:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen Unlocked</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Set Ringer Volume: Vibrate
 +
WiFi: Enable
 +
Launch Application: Slack</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Time of Day: 9:00 AM - 5:00 PM
 +
Day of Week: Monday - Friday</pre>
 +
 
 +
'''Example 3: Security logging'''
 +
 
 +
Log all device unlock events for security monitoring:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen Unlocked</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Log to file: "Device unlocked at [date] [hour]:[minute]:[second]"
 +
Set Variable: [unlock_count] = [unlock_count] + 1</pre>
 +
 
 +
''' 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 '''
 +
 
 +
* [[Trigger:_Screen_On/Off|Screen On/Off]]
 +
* [[Constraint:_Device_Locked/Unlocked|Device Locked/Unlocked Constraint]]

Latest revision as of 21:48, 6 January 2026

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