Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Latest commit

 

History

History
51 lines (34 loc) · 1.73 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.73 KB

cwcr

clipboard write, clipboard read, a fish shell facade to interact with the clipboard.

As of fish 3.6.0, the two built-in functions fish_clipboard_copy and fish_clipboard_paste effectively make using giorgiga/cwcr superfluous.

Please consider uninstalling cwcr and aliasing the new functions as cw and cr, for example by running:

fisher remove giorgiga/cwcr
alias -s cw fish_clipboard_copy
alias -s cr fish_clipboard_paste

Installation

Using Fisher

fisher install giorgiga/cwcr

Manually

curl -Lo ~/.config/fish/conf.d/cwcr.fish  --create-dirs \
     https://raw.githubusercontent.com/giorgiga/cwcr/main/conf.d/cwcr.fish
curl -Lo ~/.config/fish/functions/cw.fish --create-dirs \
     https://raw.githubusercontent.com/giorgiga/cwcr/main/functions/cw.fish
curl -Lo ~/.config/fish/functions/cr.fish --create-dirs \
     https://raw.githubusercontent.com/giorgiga/cwcr/main/functions/cr.fish

Dependencies

In order for cwcr to work, you'll need:

  • wl-clipboard, if you use Wayland
  • xcopy and/or xsel, if you use X11
  • optionally, perl (without it, you may run into issues when copying or pasting more than 100MiB of data)

Usage

This package adds two functions:

  • cw (clipboard write) reads from standard input and writes to the clipboard
  • cr (clipboard read) reads from the clipboard and writes to standard output

When writing to the cliboard, the last newline (if any) is ignored and so after executing (eg) echo hello world | cw the clipboard will contain hello world and not hello world\n.

If run in a non-graphical session, cwcr will read/write from a temporary file instead of the clipboard.