Clipixir (clipixir v0.1.0)

View Source

Clipixir 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 a list of %{value, encoded, last_used, count} entries, newest first.

Promotes the given clipboard string to the top of the history, increments its usage count, and removes older duplicate entries. Also updates the timestamp.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(_)

Callback implementation for GenServer.init/1.

list_history()

Returns a list of %{value, encoded, last_used, count} entries, newest first.

Example

iex> Clipixir.list_history()
[%{value: "foobar", count: 4, last_used: 1715753340, encoded: ...}, ...]

promote_to_top_and_dedup(selected_clip)

Promotes the given clipboard string to the top of the history, increments its usage count, and removes older duplicate entries. Also updates the timestamp.

iex> Clipixir.promote_to_top_and_dedup("foo bar")
:ok  # (side effect: updates file)

start_link(opts)