A macOS system service (LaunchAgent) that automatically copies new screenshots to your clipboard as soon as they are created.
The daemon monitors your screenshot directory using FSEvents—a macOS kernel mechanism that notifies the app of new files without polling the file system. Once a new file is detected, the daemon waits for 300ms (to let the file finish writing) and copies the image to the clipboard using NSPasteboard.
Cmd-Shift-3/4 → macOS writes file → Kernel (FSEvents) → Daemon
↓
Clipboard
(Ready for Cmd-V)
git clone <url> && cd auto-copy-screenshot
./install.shThe script:
- Compiles the Swift code into a binary (
~/.local/bin/auto-copy-screenshot) - Creates a LaunchAgent plist in
~/Library/LaunchAgents/ - Loads the agent—the process starts and runs automatically on every login
Logs are written to /tmp/auto-copy-screenshot.log.
# Check status (PID = running)
launchctl list com.auto-copy-screenshot
# View logs
tail -f /tmp/auto-copy-screenshot.log
# Stop
launchctl unload ~/Library/LaunchAgents/com.auto-copy-screenshot.plist
# Start again
launchctl load ~/Library/LaunchAgents/com.auto-copy-screenshot.plist
# Restart
launchctl unload ~/Library/LaunchAgents/com.auto-copy-screenshot.plist
launchctl load ~/Library/LaunchAgents/com.auto-copy-screenshot.plist./uninstall.shStops the agent, deletes the plist, the binary, and the log file.
swiftc -O -o auto-copy-screenshot Sources/main.swiftBy default: PNG, JPG, GIF, TIFF, BMP, HEIC, WebP.