How sentriz/cliphist works
cliphist is a pipe-oriented Wayland clipboard-history manager. Its main workflow watches clipboard changes and stores them, lists selectable previews, then decodes a selected ID to restore the original bytes. It also supports metadata listing, deletion, expiration, and compaction. The sampled implementation is a single Go source file; README-described picker and image-preview integrations are shown where their paths are documented, but their internal behavior was not inspected.
Main entry points: cliphist.go cliphist CLI · contrib Image picker scripts
Components 15
History commands
- cliphist CLI
cliphist.go - Store clipboard
cliphist.go - List entries
cliphist.go - Decode entry
cliphist.go - Delete entry
cliphist.go - Delete by query
cliphist.go - Wipe / expire
cliphist.go - Compact history
cliphist.go
History data
- Metadata and previews
cliphist.go - BoltDB history
cliphist.go
Picker integrations
- Menu / picker
- Image picker scripts
contrib
Other components
- User
- wl-paste watcher
- wl-copy
Connections 25
- User → wl-paste watcher: starts watch
- wl-paste watcher → cliphist CLI: pipes clipboard
- User → cliphist CLI: runs command
- cliphist CLI → Store clipboard: dispatches
- cliphist CLI → List entries: dispatches
- cliphist CLI → Decode entry: dispatches
- cliphist CLI → Delete entry: dispatches
- cliphist CLI → Delete by query: dispatches
- cliphist CLI → Wipe / expire: dispatches
- cliphist CLI → Compact history: dispatches
- Store clipboard → BoltDB history: writes entries
- Store clipboard → Metadata and previews: records metadata
- List entries → BoltDB history: reads entries
- List entries → Metadata and previews: formats fields
- List entries → Menu / picker: pipes listing
- Menu / picker → Decode entry: pipes selection
- Decode entry → BoltDB history: reads original bytes
- Decode entry → wl-copy: pipes restored bytes
- Delete entry → BoltDB history: deletes selected
- Delete by query → BoltDB history: deletes matches
- Wipe / expire → BoltDB history: removes entries
- Wipe / expire → Compact history: compacts afterward
- Compact history → BoltDB history: rewrites store
- Image picker scripts → List entries: uses listing
- Image picker scripts → Decode entry: uses restoration