Caution
π§ Highly Experimental & Unstable. This project is in active development and may break at any time. Expect bugs, missing features, unexpected behavior, and frequent changes.
- Implements Wayland native protocol.
- Saves raw and parsed image metadata.
- Advanced search queries.
- Restore clipboard content with metadata.
- Get clipboard as
json. - Delete clipboard item.
- Delete all history.
- Does not depend on
wl-clipboard. - Built-in way for interactive search.
- Use quickshell example for search UI.
When you copy an image, most web browsers include image/html with metadata
like url and alt. Yankd allows you to search your clipboard history using
this metadata.
Existing tools like wl-paste + cliphist lack the ability to pass this
metadata from the daemon to the database, or offer advanced querying to search
tools. Yankd solves this by directly implementing the
wlr-data-control-unstable-v1 protocol and storing clipboard events in a
relational database (DuckDB), enabling advanced searches (fuzzy, exact, regex,
time, and type filters).
Use flake:
Quick run:
nix run github:Nadim147c/yankd -- --help
yankd = {
url = "github:Nadim147c/yankd";
inputs.nixpkgs.follows = "nixpkgs";
};Requires
git,make,installandgoinstalled.
git clone https://github.com/Nadim147c/yankd.git
cd yankd
make build
make install PREFIX=$HOME/.local/go install https://github.com/Nadim147c/yankd@latest
Important
All yankd command requires the daemon to be running on the background.
Check if yankd is installed or not:
yankd --helpStart yankd daemon by running yankd daemon.
Add this to hyprland.conf:
hl.dispatch(hl.dsp.exec_cmd("yankd daemon"))Copy the following configuration to ~/.config/systemd/user/yankd.service:
[Unit]
Description=Yankd clipboard daemon
PartOf=graphical-session.target
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/local/bin/yankd daemon
Restart=on-failure
[Install]
WantedBy=graphical-session.targetThen enable and start the service:
systemctl --user daemon-reload
systemctl --user enable --now yankd.serviceList last 10 clipboard events1.
yankd list --format=json --limit=10 | jqGet a clipboard event1 as JSON by ID2.
yankd get 019f0dea-40d5-773a-ad21-aff1feba4d34Get a content of a primary3 clipboard event1
yankd get --primary 019f0dea-40d5-773a-ad21-aff1feba4d34Get a content of a primary mime-type3 clipboard event1 but encode to base64 if the content is binary data.
yankd get --primary --base64 019f0dea-40d5-773a-ad21-aff1feba4d34Set/Restore a clipboard event1 by ID2.
yankd set 019f0dea-40d5-773a-ad21-aff1feba4d34Since yankd owns the database, it provides powerful controls over database queries. Here are the query parameters:
after:"<time>": Filter items after this time. Can be human readable likelast fridaybefore:"<time>": Filter items before this time.type:"<mime-type>": Filter by mime-type. It's fuzzy match so don't need to exact.[<query>: Prefix match.<query>]: Suffix match./<pattern>/: Regex match."<pattern>": Exact Keyword match. Can add as many as you want
Get events1 before first sunday of this month.
yankd search --format=json 'hello world before:"first sunday"'Get events1 that contains the exact match world.
yankd search --format=json 'hello "world"'Get events1 images where metadata has exact match "reddit.com" and also match
the regex r/(golang|hyprland)
yankd search --format=json 'type:image "reddit.com" /r\/(golang|hyprland)/'Contributions are welcome. I don't care if your PR is AI generated. Review the PR with as much time as you expect me to spend reviewing it.
Yankd does not have a GUI and likely never will. However, you can easily create a GUI wrapper without rewriting the search logic and Wayland protocol. Yankd commands depend on the background daemon, sending requests to it and printing the results. The daemon uses HTTP over Unix sockets. More documentation is available in ipc.
This repository is licensed under the GPL-v3.