A nushell plugin for interacting with the clipboard, allowing you to copy/paste text, objects, and tables.
-
clipboard copy: Copies input text to the clipboard.-
Daemon Mode (Linux only): Since version 0.105.2, plugin will try to detect display server using env variables. If there is any issue with copy/paste command This config will override this behavior. If you need to override this, please file an issue:
$env.config.plugins.clipboard.NO_DAEMON = true # or false
-
Silent Copy: Added support for silent copying (requested in #23).
You can disable echoing of copied content globally with:$env.config.plugins.clipboard.SILENT_COPY = true
or per invocation using
--silent (-s)flag -
To make these settings permanent, add it to your env vars using
config env.
-
-
clipboard paste: Retrieves the current clipboard content.
If you encounter the error:
Error: × Clipboard Error: The clipboard contents were not available in the requested format... on Linux:
- For users running Wayland without the
nupminstaller, enable theuse-waylandfeature as described in #21. - Alternatively, try disabling daemon mode, as explained in #20.
Note: These issues are already fixed internally. If you still need to rely on these workarounds, please open a new issue.
"test value" | clipboard copy clipboard paste- Tables and objects are internally converted to JSON.
- When pasting,
clipboard pastetries to parse JSON into a table or object. - If parsing fails, the content is returned as a string.
$env | clipboard copy
clipboard paste
ps | clipboard copy
clipboard paste🚀 Recommended: Using nupm
This method automatically handles dependencies and features:
git clone https://github.com/FMotalleb/nu_plugin_clipboard.git
nupm install --path nu_plugin_clipboard -fuse-wayland: Prioritizes the Wayland API, but falls back to X11 if needed.
git clone https://github.com/FMotalleb/nu_plugin_clipboard.git
cd nu_plugin_clipboard
cargo build -r
plugin add target/release/nu_plugin_clipboardcargo install --git https://github.com/FMotalleb/nu_plugin_clipboard.git
plugin add ~/.cargo/bin/nu_plugin_clipboard- Since I live in Iran and crates.io won't let me update my packages like a normal person, most of the time crates.io is outdated.
cargo install nu_plugin_clipboard
plugin add ~/.cargo/bin/nu_plugin_clipboard