Skip to content

lemur1905/CleanPaste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CleanPaste

A tiny macOS menu-bar utility that pastes clipboard text with line-break artifacts and other noise cleaned up. Triggered by a single hotkey.

Default hotkey: ⌥⌘V (Option + Command + V).

What it cleans up

When you press the hotkey, CleanPaste reads your clipboard, applies the enabled transforms in order, pastes the result into the focused app, then restores your original clipboard ~150 ms later (so a subsequent ⌘V still has what you originally copied).

Transforms (all configurable in Preferences):

  • Line breaks — three modes:
    • Smart (default): single newlines become spaces; runs of two or more collapse to a paragraph break. Best general-purpose for hard-wrapped prose from PDFs and emails.
    • Replace all with spaces — every newline becomes a space.
    • Remove entirely — every newline is deleted, no replacement.
  • Rejoin hyphenated words across linesexam-\npleexample. PDF/book copy.
  • Collapse multiple spaces — runs of spaces/tabs become a single space.
  • Normalize smart quotes“ ” ‘ ’" " ' '. Useful when pasting into code, JSON, or terminals.
  • Trim leading/trailing whitespace — strips whitespace from both ends.

Rich-text formatting (colors, fonts, links) is always stripped — CleanPaste pastes plain text.

Install

Download CleanPaste.app from the latest release (link will be live after the first release is published), then:

  1. Move CleanPaste.app to /Applications.
  2. First launch: right-click the app → Open → confirm. macOS will warn that the app is from an unidentified developer (because it's signed with my own self-signed cert, not Apple's). After this once, double-click works normally.
  3. Open the app — a clipboard icon appears in your menu bar.
  4. The first time you press the hotkey, you'll get an alert asking for Accessibility permission — needed to send the paste keystroke. Click "Open System Settings" and toggle CleanPaste on under Privacy & Security → Accessibility.

Use

  • ⌥⌘V in any app — pastes the cleaned version of your clipboard.
  • Menu bar icon → Preferences… (or ⌘,) — change line-break mode, toggle individual cleanups, enable Launch at Login.
  • Menu bar icon → Enabled — uncheck to make the hotkey pass through normally (e.g., when an app uses ⌥⌘V for something else).

Known limitations

  • Hotkey is currently hardcoded to ⌥⌘V. Rebinding UI will land in a future release.
  • Unsigned distribution. Not notarized by Apple. The first-launch right-click → Open dance is the cost of not paying for an Apple Developer account ($99/yr).
  • Smart quotes for (en-dash) etc. aren't normalized. Only the curly quotes are.

Build from source

Currently SwiftPM-only (the project will migrate to a real .xcodeproj once Xcode is installed on the dev machine).

git clone https://github.com/lemur1905/CleanPaste.git
cd CleanPaste
./Scripts/build-app.sh
open build/CleanPaste.app

The build script signs the resulting .app with the identity in CODESIGN_IDENTITY (default CleanPaste Dev, a self-signed code-signing certificate in the user's keychain). For ad-hoc signing, set CODESIGN_IDENTITY=-.

Requirements: macOS 14+, Swift 5.9+ (ships with both Xcode and Command Line Tools).

License

MIT — see LICENSE.

About

macOS menu-bar utility that cleans line-break artifacts and formatting noise from pasted text via a hotkey

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors