Clipixir (clipixir v0.1.2)
View SourceClipixir is a terminal clipboard manager and history tracker.
Features
- Auto-promotes most recent clipboard entry.
- Deduplicates and stores last 1000 clipboard texts.
- Tracks usage count and last used timestamp.
- Plain text history file, easy to inspect or backup.
- Robust against crash, restarts, accidental bad lines.
Example
# Start tracking clipboard in the background
{:ok, _pid} = Clipixir.start_link([])
# List clipboard history (returns list of %{value, count, last_used, ...})
Clipixir.list_history()
# Promote a copied entry explicitly (if not already tracked)
Clipixir.promote_to_top_and_dedup("your copied content")
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1
.
Returns the clipboard history from the last N days (default: 7) as a list of maps.
Moves the given clipboard string to the top of the history.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Callback implementation for GenServer.init/1
.
Returns the clipboard history from the last N days (default: 7) as a list of maps.
Each entry is a map with keys:
:value
— the decoded clipboard text (string):encoded
— base64-encoded string (internal use):last_used
— Unix timestamp (when this value was last seen/copied)
The result is ordered new-to-old (most recent first).
Entries older than 7 days are excluded from the returned list.
Example
iex> Clipixir.list_history()
[
%{value: "password123", encoded: "...", last_used: 1718665404},
%{value: "Elixir cheatsheet", encoded: "...", last_used: 1718600000}
]
Returns []
if no history exists or all entries are older than 7 days.
Moves the given clipboard string to the top of the history.
- If the value already exists, removes all other copies and updates the timestamp to now.
- If it does not exist, adds it as the newest/first entry.
- Maintains only entries from the last 7 days.
Returns :ok
after updating history.
Example
iex> Clipixir.promote_to_top_and_dedup("New clipboard text")
:ok
After running this, Clipixir.list_history()
will have
"New clipboard text" as the top/most-recent entry,
with all other instances of that value removed.
If the given value was not in the history, it is added as the new first entry. If already at the top, timestamp is updated.