Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-copy-screenshot

A macOS system service (LaunchAgent) that automatically copies new screenshots to your clipboard as soon as they are created.

How It Works

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)

Installation

git clone <url> && cd auto-copy-screenshot
./install.sh

The script:

  1. Compiles the Swift code into a binary (~/.local/bin/auto-copy-screenshot)
  2. Creates a LaunchAgent plist in ~/Library/LaunchAgents/
  3. Loads the agent—the process starts and runs automatically on every login

Logs are written to /tmp/auto-copy-screenshot.log.

Management

# 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

Uninstallation

./uninstall.sh

Stops the agent, deletes the plist, the binary, and the log file.

Manual Build

swiftc -O -o auto-copy-screenshot Sources/main.swift

Supported Formats

By default: PNG, JPG, GIF, TIFF, BMP, HEIC, WebP.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages