How henno/macos-clipboard-manager works
cbm is a macOS clipboard-history app. Its main workflow monitors the pasteboard, filters and preserves clipboard representations, stores history, then lets the user search and preview an entry before restoring it to the clipboard and optionally pasting into the app they left. The graph also shows settings, retention, menu-bar access, and performance measurements. Wiring for unsampled UI and favicon code is limited to capabilities and relationships documented in the README; uncertain links are omitted.
Main entry points: PanelController.swift Search panel · ItemStore.swift History store · SettingsWindowController.swift Settings window · ClipboardMonitor.swift Clipboard monitor
Components 26
App runtime
- App delegate
Sources/cbm/AppDelegate.swift - Global hotkey
Sources/cbm/UI/HotKey.swift - Menu bar
Sources/cbm/UI/MenuBarController.swift
Capture and storage
- Clipboard monitor
Sources/cbm/Capture/ClipboardMonitor.swift - Pasteboard reader
Sources/cbm/Capture/PasteboardReader.swift - Frontmost tracker
Sources/cbm/Capture/FrontmostTracker.swift - History store
Sources/cbm/Store/ItemStore.swift - SQLite database
Sources/cbm/Store/Database.swift - Blob and thumbnail files
Sources/cbm/Store/BlobStore.swift
Find and preview
- Search panel
Sources/cbm/UI/PanelController.swift - Search index
Sources/cbm/Search/SearchIndex.swift - Fuzzy matching
Sources/cbm/Search/FuzzyMatcher.swift - Text folding
Sources/cbm/Search/TextFold.swift - Entry preview
Sources/cbm/UI/PreviewView.swift - Favicon store
Sources/cbm/UI/FaviconStore.swift
Paste workflow
- Clipboard restore
Sources/cbm/Paste/Paster.swift
Settings and status
- Settings window
Sources/cbm/UI/SettingsWindowController.swift - Preferences
Sources/cbm/Support/Settings.swift - Live metrics
Sources/cbm/Support/Metrics.swift - Login item
Sources/cbm/UI/LoginItem.swift
Other components
- User
- macOS pasteboard
- System SQLite
- Chrome favicon cache
- Previous app
- macOS Accessibility
Connections 33
- User → Global hotkey: presses shortcut
- App delegate → Clipboard monitor: starts monitoring
- App delegate → Global hotkey: registers shortcut
- App delegate → Menu bar: installs menu
- Global hotkey → Search panel: opens panel
- Menu bar → Search panel: opens panel
- Menu bar → Settings window: opens settings
- Clipboard monitor → macOS pasteboard: checks changes
- Clipboard monitor → Pasteboard reader: reads changed content
- Pasteboard reader → History store: submits payload
- Clipboard monitor → History store: stores payload
- History store → SQLite database: reads and writes
- History store → Blob and thumbnail files: stores large payloads
- SQLite database → System SQLite: uses
- Search panel → Clipboard monitor: polls before opening
- Search panel → Search index: queries and updates
- Search index → Fuzzy matching: scores terms
- Search index → Text folding: folds query and text
- Search panel → Entry preview: shows selection
- Entry preview → History store: loads full payload
- Search panel → History store: deletes selection
- Search panel → Clipboard restore: restores selection
- Search panel → Frontmost tracker: tracks paste target
- Frontmost tracker → Clipboard restore: provides target app
- Clipboard restore → macOS pasteboard: writes representations
- Clipboard restore → Previous app: activates and pastes
- Settings window → Preferences: reads and updates
- Settings window → History store: applies retention and clears
- Settings window → Live metrics: reads measurements
- Settings window → Login item: configures login
- Clipboard restore → macOS Accessibility: checks permission
- Favicon store → Chrome favicon cache: reads copied cache
- Search panel → Favicon store: warms displayed icons