Skip to content
xdlkcPublic

About

Native macOS menu bar clipboard history manager with global hotkey recall, fuzzy search, type filters, SQLite persistence & direct paste.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Vestige (余痕)

English | 简体中文

Every snippet of text, image, or file you copy leaves a trace you can recall at any moment.

Vestige is a native macOS menu bar clipboard history and instant recall utility built with Swift and AppKit (pure Swift Package Manager, macOS 13+). Running as an LSUIElement menu bar app with no Dock icon, it opens on ⌘⌥C with fuzzy search, content-type filtering, and direct ↩ paste into your active app.

Naming Note: The project brand is Vestige (余痕), while code targets, bundle artifacts, and storage paths retain the ClipboardHistory identifier (ClipboardHistory.app, ~/Library/Application Support/ClipboardHistory/, CLIPBOARD_HISTORY_DB) to match the codebase and preserve existing user history.

Quick Start

Option 1: Install from GitHub Releases

  1. Download the Universal (arm64 + x86_64) .dmg or .zip archive (plus SHA256SUMS) from GitHub Releases (requires macOS 13+).
  2. Optionally verify checksums in the download directory:
    shasum -a 256 -c SHA256SUMS
  3. Quit any running instance, open the .dmg (or extract the .zip), and drag ClipboardHistory.app into /Applications.
  4. First Launch (Gatekeeper): Release packages are ad-hoc signed and not Apple-notarized. On first launch, double-click ClipboardHistory.app in /Applications, dismiss the warning dialog, open System Settings › Privacy & Security, scroll to Security, and click Open Anyway. (See packaging/安装说明.txt for step-by-step details.)

Option 2: Build Locally & Install

./build.sh
# Quit any running instance first, then copy the bundle to /Applications:
cp -R build/ClipboardHistory.app /Applications/

Grant Accessibility Permission (For Auto-Paste)

Pressing ↩ to automatically paste (⌘V) into the active application requires macOS Accessibility permission:

  1. Open System Settings › Privacy & Security › Accessibility (or click the menu bar icon › 辅助功能设置 / Accessibility Settings).
  2. Enable ClipboardHistory (or click + to add it from /Applications).
  3. Without Accessibility permission, Vestige still copies the selected entry to the clipboard for manual ⌘V pasting and displays a ⚠️ indicator in the panel status bar.

Keyboard Shortcuts & Usage

Panel Shortcuts

Shortcut / Action Behavior
⌘⌥C Show or hide the clipboard panel (customizable)
Type directly Fuzzy-search clipboard history
Filter dropdown Filter by All / Text / Links / Images / Files (combined with search query)
↑ / ↓ Move selection up / down
↩ or click row Paste selected item directly into the previous active app
⌘↩ Copy selected item to the clipboard without auto-pasting
⌘⌫ Delete selected item
⇧⌘P Pin or unpin selected item
Esc Clear the search query first; press again to close the panel

Filtering, Retention & Privacy

  • Content-Type Filtering: Filter by All, Text, Links, Images, or Files alongside fuzzy search. Switching filter types preserves the search query and selects the first match; incoming copies keep the active filter; reopening the panel resets to All and clears the search box. (Links matches a single complete HTTP/HTTPS URL after trimming whitespace; paragraphs containing URLs or other protocols remain Text.)
  • Global Hotkey Customization: Open menu bar › 设置全局快捷键… (Configure Global Hotkey) to pick any A–Z / 0–9 physical ANSI key combined with at least one of Command, Option, or Control. Changes take effect immediately and persist across restarts via UserDefaults (globalHotkey). If registration fails (for example, due to a conflict), an alert is shown and the previous hotkey is preserved.
  • Menu Bar Actions: Open Panel, Configure Global Hotkey…, Launch at Login (requires /Applications), Accessibility Settings, Clear Unpinned History… (keeps pinned items), and Quit.
  • Local SQLite Storage: History is stored locally at ~/Library/Application Support/ClipboardHistory/history.db with SHA256 content deduplication. Unpinned entries are kept for 90 days up to 1,000 items; pinned entries are kept indefinitely. Sensitive or transient items flagged by password managers are ignored. Override the database location for testing with CLIPBOARD_HISTORY_DB=/path/to/test.db.

Project Structure

  • Sources/ClipboardCore: Pure Swift logic (no AppKit dependency) — Fuzzy, RowText, Store (SQLite), content SHA256, HistoryFilter, HotkeySettings, PanelModel, PasteFlow, and StatusMenu.
  • Sources/ClipboardCapture: Pasteboard reading/writing and thumbnail generation (AppKit, no UI).
  • Sources/ClipboardHistory: AppKit menu bar shell, floating panel, Carbon global hotkey, and simulated ⌘V.
  • Tests: XCTest unit test suites (ClipboardCoreTests and ClipboardCaptureTests).
  • design/panel.html: High-fidelity HTML prototype of the main panel.
  • assets/icon-1024.png & make-icon.swift: Source square icon and programmatic .icns builder.
  • Info.plist, build.sh, package.sh, packaging/安装说明.txt: App bundle manifest, local universal build/sign script, ZIP/DMG packaging script, and user guide.
  • scripts/: Release verification and CI smoke-test scripts (ci-capture-smoke.sh, ci-panel-smoke.sh, ci-hotkey-smoke.sh, ci-verify-package.sh, smoke-release.sh, verify-release-app.py, check-release-version.sh).

Developer Build, Signing & Release

Development & Unit Tests

Requires Xcode Command Line Tools (macOS 13 SDK or later):

swift build -c release --arch arm64
swift build -c release --arch x86_64
swift test

Outputs for each architecture live under .build/<triple>/release/ (do not rely on the .build/release symlink).

Local App Build (build.sh)

./build.sh                 # Signs with local code-signing identity if present; falls back to ad-hoc
SIGN=adhoc ./build.sh      # Force ad-hoc signing

build.sh compiles both arm64 and x86_64 release binaries, combines them via lipo, generates AppIcon.icns from assets/icon-1024.png, assembles build/ClipboardHistory.app, and verifies codesign.

Self-signed certificate setup (preserve Accessibility permission across rebuilds)

macOS ties Accessibility permissions to the app's code signature. Ad-hoc signatures change on every rebuild, requiring you to re-grant Accessibility permission after replacing /Applications/ClipboardHistory.app. Signing locally with a persistent self-signed certificate avoids re-authorization across rebuilds (create once locally; never run this in CI):

cd "$(mktemp -d)"
cat > cert.cnf <<'EOF'
[req]
distinguished_name = dn
x509_extensions = ext
prompt = no
[dn]
CN = ClipboardHistory Self-Signed
[ext]
basicConstraints = critical, CA:false
keyUsage = critical, digitalSignature
extendedKeyUsage = critical, codeSigning
EOF
/usr/bin/openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -config cert.cnf -keyout key.pem -out cert.pem
/usr/bin/openssl pkcs12 -export -inkey key.pem -in cert.pem -name "ClipboardHistory Self-Signed" -out cert.p12 -passout pass:tmp
security import cert.p12 -k ~/Library/Keychains/login.keychain-db -P tmp -T /usr/bin/codesign
security add-trusted-cert -r trustRoot -p codeSign -k ~/Library/Keychains/login.keychain-db cert.pem
security find-identity -v -p codesigning     # Should list "ClipboardHistory Self-Signed"
rm -f key.pem cert.p12
  • Uses macOS system /usr/bin/openssl (LibreSSL). With Homebrew OpenSSL 3, add -legacy to pkcs12 -export so Keychain can import the .p12.
  • add-trusted-cert prompts for your login password; on the first sign, Keychain may ask permission for codesign to use the private key (select Always Allow).
  • To use a different certificate name, run SIGN_IDENTITY="Your Certificate Name" ./build.sh.
  • The first time you switch from ad-hoc to certificate signing, remove the old entry in System Settings › Privacy & Security › Accessibility and re-add it once; subsequent replacements keep the permission.

Distribution Packaging (package.sh)

./package.sh

Builds a forced ad-hoc universal app and outputs dist/ClipboardHistory-<version>.zip, dist/ClipboardHistory-<version>.dmg (with /Applications symlink and 安装说明.txt), and dist/SHA256SUMS. It unpacks the ZIP and mounts the DMG to verify signatures and architectures before cleaning up intermediate .app bundles. Version comes from CFBundleShortVersionString in Info.plist.

CI & Release Workflows

  • .github/workflows/ci.yml: Runs on pull_request and push to main (skipping doc-only changes). macos-15 builds universal binaries (-warnings-as-errors), runs unit tests, executes pasteboard/panel/hotkey smoke tests against an isolated temporary DB, packages ZIP/DMG, and verifies signatures; macos-26 verifies release build + unit tests on the macOS 26 SDK.
  • .github/workflows/release.yml: Builds universal packages and verifies native launch on both macos-15 (arm64) and macos-15-intel (x86_64) runners. Pushing a v<major>.<minor>.<patch> tag matching Info.plist creates a draft Release for manual review and publishing. (CI validates macOS 13 deployment targets on each Mach-O slice and plist; physical macOS 13 hardware is not tested in CI.)

About

Native macOS menu bar clipboard history manager with global hotkey recall, fuzzy search, type filters, SQLite persistence & direct paste.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages