Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 734 Bytes

File metadata and controls

36 lines (26 loc) · 734 Bytes

ScreenLockDetector

macOS service that executes Shortcuts based on screen lock/unlock events.

Setup

  1. Edit ScreenLockDetector.swift and update:
static let setOnShortcut = "Your Unlock Shortcut"
static let setOffShortcut = "Your Lock Shortcut"
  1. Run the install script:
./install.sh

Useful commands

# View logs
tail -f /tmp/screen-lock-detector.log

# Stop service
launchctl stop $USER.screen-lock-detector

# Uninstall
launchctl unload ~/Library/LaunchAgents/$USER.screen-lock-detector.plist
rm ~/Library/LaunchAgents/$USER.screen-lock-detector.plist
rm -rf ~/Library/Application\ Support/ScreenLockDetector

Requirements

  • macOS 15.5+
  • Shortcuts configured in Shortcuts.app