#clipboard #nushell #nushell-plugin #plugin

app nu_plugin_clipboard

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

5 unstable releases

0.91.0 Mar 7, 2024
0.3.4 Feb 12, 2024
0.3.1 Nov 28, 2023
0.3.0 Nov 19, 2023
0.2.0 Nov 15, 2023

#449 in Text processing

Download history 28/week @ 2024-02-11 17/week @ 2024-02-18 13/week @ 2024-02-25 142/week @ 2024-03-03 35/week @ 2024-03-10 6/week @ 2024-03-17 1/week @ 2024-03-24 36/week @ 2024-03-31

91 downloads per month

MIT and maybe CC-PDDC

20KB
210 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)
  • 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: force copy command to spawn a daemon and revert the functionality of --daemon flag
  • or compile manually

git clone https://github.com/FMotalleb/nu_plugin_clipboard.git
cd nu_plugin_clipboard
cargo build -r
register target/release/nu_plugin_clipboard
  • or using cargo
cargo install nu_plugin_clipboard
register ~/.cargo/bin/nu_plugin_clipboard

Dependencies

~14–50MB
~771K SLoC