A lightweight macOS application that prevents system and display sleep through system tray integration.
Inactive State (Sleep Allowed)
Active State (Sleep Prevented)
- Prevents system sleep and display sleep
- System tray integration with toggle functionality
- Simulates user activity to maintain active state
- Clean exit handling with proper resource cleanup
- macOS (darwin)
- Go 1.24+
- CGO enabled
- Xcode Command Line Tools (for system frameworks)
git clone https://github.com/alexrett/idler.git
cd idler
make buildThe build process creates a macOS application bundle and copies it to ~/Applications/.
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -o idler .- Launch the application from Applications folder
- The app runs in the system tray with a sleep icon
- Click the tray icon and select "Prevent Sleep" to activate
- The icon changes to indicate active state
- Select "Allow Sleep" to deactivate or "Quit" to exit
When active, the application:
- Creates IOKit power management assertions
- Simulates user activity every 30 seconds
- Performs minimal mouse movements to prevent idle detection
The application uses:
- IOKit Power Management API for sleep prevention
- Core Graphics for user activity simulation
- System tray integration via getlantern/systray
- CGO bindings for macOS system frameworks
github.com/getlantern/systray- Cross-platform system tray library
The included Makefile handles:
- Cross-compilation for macOS
- Application bundle creation
- Icon and Info.plist integration
- Installation to Applications folder
This project is provided as-is without warranty.