#nushell-plugin #clipboard #nushell #text-input #plugin

app nu_plugin_clipboard

A nushell plugin to copy text into clipboard or get text from it

10 releases (breaking)

new 0.101.0 Jan 3, 2025
0.100.0 Nov 15, 2024
0.99.1 Nov 3, 2024
0.91.0 Mar 7, 2024
0.3.1 Nov 28, 2023

#9 in #text-input

Download history 154/week @ 2024-09-18 42/week @ 2024-09-25 12/week @ 2024-10-02 11/week @ 2024-10-09 7/week @ 2024-10-16 3/week @ 2024-10-23 120/week @ 2024-10-30 38/week @ 2024-11-06 137/week @ 2024-11-13 24/week @ 2024-11-20 10/week @ 2024-11-27 19/week @ 2024-12-04 17/week @ 2024-12-11 3/week @ 2024-12-18 159/week @ 2025-01-01

183 downloads per month

MIT and maybe CC-PDDC

24KB
442 lines

nu_plugin_clipboard

A nushell plugin to copy text into clipboard or get text from it.

  • clipboard copy: copy a text that's given as input
    • --{disable or enable}-daemon (-d): spawn a daemon that manages clipboard (if copy is not working try using this flag)
    • Since version 0.100.1> this method is now always enabled in linux environments, to disable this behavior set $env.config.plugins.clipboard.NO_DAEMON to true, to make it permanent add $env.config.plugins.clipboard.NO_DAEMON = true to config env
  • clipboard paste: returns current text value of clipboard

Examples

  • to copy a string (ONLY string for now)
~> echo "test value" | clipboard copy 
  • to use a string that is in clipboard
~> clipboard paste | echo $in
  • in order to copy tables please convert them to text format like JSON, YAML, ...
    • you are able to paste them as tables again using clipboard paste | from json
~> $env | to json | clipboard copy
~> clipboard paste | from json

~> ps | to json | clipboard copy
~> clipboard paste | from json

Installing

  • using nupm Recommended!
    • this way you don't need to mess with features and it will install required features
git clone https://github.com/FMotalleb/nu_plugin_clipboard.git
nupm install --path nu_plugin_clipboard -f
  • supported features:
    • use-wayland: will prioritize wayland api but will falls back to X11 protocol on error
    • enforce-daemon: Deprecation notice: this method is now always enabled in linux environments, to disable this behavior set $env.config.plugins.clipboard.NO_DAEMON to true, to make it permanent add $env.config.plugins.clipboard.NO_DAEMON = true to config env
  • or compile manually
git clone https://github.com/FMotalleb/nu_plugin_clipboard.git
cd nu_plugin_clipboard
cargo build -r
plugin add target/release/nu_plugin_clipboard
  • or using cargo
cargo install nu_plugin_clipboard
plugin add ~/.cargo/bin/nu_plugin_clipboard

Dependencies

~24–55MB
~1M SLoC