Skip to content

Shortcuts and Terminal

⌥⌘K switches Latch on and off from any app. To change it, open Settings → General → Keyboard Shortcut, click the shortcut and press the new keys; Reset puts back ⌥⌘K. Enable global shortcut turns it off.

Latch adds three actions to the Shortcuts app: Activate Latch, Deactivate Latch and Toggle Latch. Use them in your own shortcuts and automations.

From Terminal, a script or anything that opens URLs, latch:// controls Latch:

URL What it does
latch:///activate Stay awake until turned off
latch:///activate?minutes=30 For 30 minutes
latch:///activate?hours=2 For 2 hours
latch:///activate?seconds=90 For 90 seconds
latch:///activate?waitpid=1234 Until process 1234 exits
latch:///deactivate Stop
latch:///toggle Switch on or off

For example, in Terminal:

Terminal window
open "latch:///activate?minutes=30"

To keep the Mac awake while a long command runs, latch onto its process:

Terminal window
long-running-job & open "latch:///activate?waitpid=$!"

Settings → URL Scheme lists the same examples.