VIS-CLIPBOARD(1)

πŸ’– vis-clipboard(1) πŸ’–

okay so this is the vis-clipboard(1) page from the General Commands Manual, and it's literally about reading from or writing to the system clipboard. it's giving tiny utility with main character energy, and honestly? it ate. ✨


🌸 NAME 🌸

vis-clipboard β€” read from or write to the system clipboard πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

vis-clipboard --usable

vis-clipboard --copy [--selection selection]

vis-clipboard --paste [--selection selection]

πŸŽ€ DESCRIPTION πŸŽ€

okay bestie, so vis-clipboard wraps various system-specific tools for interacting with a system clipboard. it can run in three different ways, depending on the flag you give it on the command-line. no cap. 🫢

  • --usable β€” in this mode, vis-clipboard looks for a way to interface with the system clipboard. if it finds one, it terminates with exit code 0. if no interface to the system clipboard is available, it terminates with exit code 1. it's basically the vibe check before the clipboard moment. βœ…
  • --copy β€” in this mode, vis-clipboard reads the content of standard input, and stores it in the system clipboard. so you pipe stuff in, and it's lowkey saved to the clipboard. πŸ’–
  • --paste β€” in this mode, vis-clipboard reads the content of the system clipboard, and writes it to standard output. so the clipboard content comes out the other side, ready to be piped or printed. 🌈
  • --selection selection β€” specify which selection to use, options are "primary" or "clipboard". silently ignored on platforms with a single clipboard. πŸ™ˆ

πŸ”₯ CLIPBOARD TOOLS πŸ”₯

to determine which system clipboard to use, vis-clipboard checks for these clipboard tools in the following order:

  • wl-clipboard(1) β€” Wayland (if $WAYLAND_DISPLAY is set)
  • wayclip β€” Wayland (if $WAYLAND_DISPLAY is set)
  • xclip(1) β€” X11 (if $DISPLAY is set)
  • xsel(1) β€” X11 (if $DISPLAY is set)
  • pbcopy(1) / pbpaste(1) β€” macOS
  • wslclip(1) β€” WSL (Windows Subsystem for Linux)
  • /dev/clipboard β€” Cygwin
  • termux-clipboard-{get,set} β€” Termux

like, it's literally going down the list in order until it finds its match. iconique. πŸ‘‘


⭐ EXIT STATUS ⭐

the vis-clipboard utility exits 0 on success, and >0 if an error occurs. when run with the --usable flag, an exit status of 0 means that it found a supported system-specific tool, while 1 means that clipboard access is not available. mmhm, that's the whole status situation. πŸ’…


🌸 EXAMPLES 🌸

test whether clipboard access is available:

if vis-clipboard --usable; then
        echo "Clipboard access available"
else
        echo "No clipboard"
fi

copy a friendly greeting to the clipboard:

echo "Hello, World" | vis-clipboard --copy

send the current contents of the system clipboard to be recorded and analyzed:

vis-clipboard --paste | curl -d - https://www.nsa.gov/
bestie, that last example is right there in the manual. i am simply reporting the facts. πŸ‘€βœ¨

πŸ’œ SEE ALSO πŸ’œ

pbcopy(1), pbpaste(1), vis(1), waycopy(1), waypaste(1), wl-clipboard(1), wslclip(1), xclip(1), xsel(1)


mwah πŸ’‹ β€” this iconic page says source/version Vis v0.9-531-gd89b6c27-dirty, dated November 29, 2016. periodt. πŸŽ€

πŸ“¦ where this page comes from