Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CopyPasta

CopyPasta is a lightweight macOS menu bar utility that keeps the last 20 plain-text clipboard strings in memory and lets you restore one from the menu bar.

Requirements

  • macOS Tahoe 26 or later
  • Xcode 26 or later
  • Apple Silicon Mac, or any Intel Mac supported by macOS 26

Build

Open CopyPasta.xcodeproj in Xcode, select the CopyPasta scheme, then build or run on My Mac.

You can also build from Terminal:

xcodebuild -project CopyPasta.xcodeproj -scheme "CopyPasta" -configuration Debug -destination 'platform=macOS' build

The project is configured for ad-hoc local signing. If you want to distribute it, choose your development team and bundle identifier in Xcode.

Direct Download Distribution

For a public direct-download release, CopyPasta should be signed with Developer ID, hardened runtime enabled, submitted to Apple notarization, stapled, and distributed as a ZIP. It does not need to go through the Mac App Store.

Before the first release, save notarization credentials in your Keychain. Use an app-specific password when prompted; do not store that password in the project:

xcrun notarytool store-credentials "CopyPastaNotary" --apple-id "YOUR_APPLE_ID_EMAIL" --team-id 2DP657YB3K

Then build the signed, notarized ZIP:

Distribution/package-developer-id.sh

The script creates dist/CopyPasta-1.0.zip, which is the file to upload to a website, GitHub Release, or other direct-download host. If you use a different notary profile, run:

NOTARY_PROFILE="YourProfileName" Distribution/package-developer-id.sh

Because this project is stored in iCloud Drive, the script stages the exported app outside iCloud Drive before verification and notarization. That avoids iCloud file-provider extended attributes interfering with code signing validation.

Run

Launch the app from Xcode or the built .app. CopyPasta appears only as a custom miniature flying spaghetti monster menu bar icon. It does not appear in the Dock or app switcher because LSUIElement is enabled in Info.plist.

Copy plain text in any app, then open the menu bar item to see recent clipboard entries. Selecting an entry writes that text back to the system clipboard as plain text. CopyPasta does not paste automatically; press Command-V in the target app to paste the restored text.

Selecting a saved item moves it to the top of the in-memory history. After writing the item back to NSPasteboard.general, the app updates its stored changeCount so its own restore action is not treated as a separate external clipboard event.

Privacy Model

  • Reads only NSPasteboard.PasteboardType.string
  • Ignores empty and whitespace-only text
  • Does not read rich text, images, files, or custom pasteboard types
  • Stores history in memory only
  • Keeps at most 20 unique text entries
  • Deduplicates exact text matches by moving the existing item to the top
  • Does not persist clipboard history across launches
  • Does not request Accessibility permissions
  • Does not paste into other apps
  • Does not include analytics, telemetry, logging of clipboard contents, or network code
  • Uses the macOS app sandbox without network entitlements

Project Structure

  • CopyPasta/CopyPastaApp.swift: SwiftUI app entry point and MenuBarExtra menu
  • CopyPasta/ClipboardStore.swift: pasteboard polling, in-memory history, deduplication, and restore logic
  • CopyPasta/ClipboardPreviewFormatter.swift: one-line menu preview formatting
  • CopyPasta/Info.plist: menu bar-only app configuration, including LSUIElement

Assumptions and Tradeoffs

CopyPasta polls NSPasteboard.general.changeCount every 0.5 seconds because AppKit does not provide a general clipboard-change notification. History is intentionally not encrypted or persisted because this initial version keeps clipboard contents only in process memory. The app restores selected items to the clipboard but never performs an automatic paste, avoiding Accessibility permissions and keeping behavior predictable.

About

A lightweight macOS menu bar utility that keeps your last 20 plain-text clipboard entries in memory.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages