A macOS menu bar application that allows you to set screen lock countdowns quickly.
- Set screen lock timers from 1 second to 60 minutes
- URL Scheme support for external program calls
- Minimalist menu bar interface
- Support for command line, AppleScript, and URL Scheme calls
- Download the latest release from Releases
- Double click the DMG file
- Drag the app to your Applications folder
- Click the lock icon in the menu bar
- Select a countdown duration
- The screen will lock after the selected time
The URL Scheme supports any duration in seconds, not limited to the menu options. This means you can set custom durations that are not available in the menu.
# Examples:
open "macoslock://lock?duration=60" # Lock for 1 minute
open "macoslock://lock?duration=300" # Lock for 5 minutes
open "macoslock://lock?duration=600" # Lock for 10 minutes
open "macoslock://lock?duration=1800" # Lock for 30 minutes
open "macoslock://lock?duration=3600" # Lock for 1 hour- The duration parameter is in seconds
- You can set any duration, even if it's not in the menu
- The app must be running for URL Scheme to work
- The duration parameter is independent of menu options
- No maximum time limit (use with caution)
tell application "MacOSLock"
open location "macoslock://lock?duration=300"
end tell- Swift 5.5+
- macOS 10.15+
- Xcode 12+
macOS-keep-lock-app/
├── Sources/
│ └── MenuBarApp/
│ ├── AppDelegate.swift # Main application logic
│ └── main.swift # Application entry point
├── MenuBarApp.app/ # Compiled application
├── MacOSLock.dmg # Distribution package
└── README.md # This file
- GitHub: guomengtao
This project is licensed under the MIT License - see the LICENSE.md file for details.