Clipvault
Clipboard history manager for Wayland, inspired by cliphist
demo.mp4Features
Like cliphist:
- Save history: clipboard entries are stored in a local database
- Recall history: recall saved entries using any picker you like (e.g.
dmenu,rofi,wofi, etc.) - Simple: no builtin picker, only pipes - keep it simple (stupid)
- Any data: support for text, images and any other binary data
- Preservation: entries are preserved byte-for-byte, including leading/trailing whitespace
In addition:
- No silent failures: invalid arguments cause errors, and are also written to log files
- Relative positions: support for getting/deleting items by relative position in the saved history
- Entry size limits: configurable minimum and maximum size for stored entries
- Entry age limit: configurable max age for entries - automatically remove old clipboard entries
- Ignore entries: avoid storing certain text data using regex patterns, e.g.
^<meta http-equiv= - Ignore windows: avoid storing data from specific windows using regex patterns, e.g.
.*Pass.* - Informative previews: previews for binary data support many more types, e.g.
video/mp4,application/pdf, etc.
Requirements
- wl-clipboard, or anything with an interface
equivalent to
wl-paste --watchto keepclipvaultupdated with the latest clipboard entries.
Installation
Cargo
cargo install clipvault --locked
Or, directly from source:
cargo install --git https://github.com/rolv-apneseth/clipvault --locked
AUR
paru -S clipvault
Nix flakes
Add clipvault to your flake inputs:
inputs = { clipvault = { url = "github:Rolv-Apneseth/clipvault"; # If you need a specific version: ref = "refs/tags/v1.3.0"; }; # ... };
Then you can add it to your packages:
let system = "x86_64-linux"; # OR: system = "aarch64-linux"; in { environment.systemPackages = with pkgs; [ # ... inputs.clipvault.packages.${system}.default ]; }
Manual
-
Download the tarball for your computer's architecture (probably
x86_64) from the releases page -
Unpack the tarball, e.g.:
tar -xf clipvault-x86_64-unknown-linux-gnu.tar.gz
-
Place the
clipvaultbinary in your$PATH
Setup
wl-paste --watch clipvault store
This will listen for changes from the Wayland clipboard and write each entry to the history. Call it once per session - for example:
-
Hyprland:
exec-once = wl-paste --watch clipvault store -
Sway:
exec wl-paste --watch clipvault store
Filtering
If you wish to narrow down the MIME types copied to clipvault, you can run wl-paste --watch
once for each type that should actually get forwarded to clipvault:
wl-paste --type text --watch clipvault store # Forward text data wl-paste --type image --watch clipvault store # Forward raw image data
Tip
Use wl-paste --list-types to find the available MIME types for the currently copied data in the
Wayland clipboard.
Image data from browsers
When copying images from browsers, wl-paste will usually pass the data to clipvault as text/html.
This is not ideal for copying images, and you probably want to have the raw image data copied instead.
If so, you can either only forward image data, or, more realistically, use the commands below to
copy the image data directly, and ignore the text/html:
Note also that by default wofi may sort entries alphabetically or by its cache. To display entries
in the order they are produced, try adding the following arguments to the wofi call above:
-d -k /dev/null
clipvault list | tofi | clipvault get | wl-copy
For more advanced setups, checkout some of the scripts in the extras directory. Contributions are welcome.
Tip
To avoid proceeding with copying if no entry was selected in the picker, try replacing
clipvault get | wl-copy from any of the above commands with
{ read -r output && clipvault get <<< "$output" | wl-copy }
Configuration
While there is no support for a dedicated configuration file, clipvault does support loading additional
CLI arguments from files, thanks to argfile.
To use this functionality, create a file with one argument per line, like this example.
Then, provide its path to the CLI using:
clipvault @/path/to/argfile
Tip
Most options can also be set using environment variables - check out the help output
for each command to find the specific variable to set for each.
Contributing
All contributions are welcome. If you run into any problems, or have any suggestions/feedback, feel free to open an issue.
This project is written in Rust, so for contributing code:
-
Ensure rustup is installed - this project uses the stable toolchain for most things, but nightly for the formatting.
-
Make your changes and ensure they work as expected -
cargo run -- your_args_here. -
Lint + format + run tests:
cargo clippy --all -- -W clippy::all && cargo +nightly fmt && cargo test
-
LGTM 👍
I like just, so I keep some utility commands in the justfile. Check that out for additional checks which are run in the CI.
Similar programs
Acknowledgements
- cliphist of course
- All the dependencies of this project, and all their dependencies too
License
This code is licensed under the AGPLv3.
See the LICENSE file for more details.