https://github.com/nnbnh/cb
📋 Clipboard managers warper written in POSIX sh (mirror)
https://github.com/nnbnh/cb
basher bpkg-package cli clipboard clipboard-manager command-line-tool posix-sh wapper
Last synced: about 1 month ago
JSON representation
📋 Clipboard managers warper written in POSIX sh (mirror)
- Host: GitHub
- URL: https://github.com/nnbnh/cb
- Owner: NNBnh
- License: mit
- Created: 2023-01-26T15:34:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T12:27:40.000Z (almost 3 years ago)
- Last Synced: 2025-01-27T15:42:30.599Z (over 1 year ago)
- Topics: basher, bpkg-package, cli, clipboard, clipboard-manager, command-line-tool, posix-sh, wapper
- Language: Shell
- Homepage: https://codeberg.org/NNB/cb
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cb
Clipboard managers warper written in POSIX sh
## 💡 About
`cb` is a clipboard managers warper written in POSIX sh that wraps various system-specific tools for interacting with a system clipboard.
This is literally a port of [`clipboard.zsh` plugin](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh) from [Oh My Zsh](https://github.com/ohmyzsh) as a stand alone utility.
### ✨ Features
- Work with `tee` like pipeline (e.g: `ls | cb | grep -e 'string'`)
- Supported clipboard managers are:
- `pbcopy`, `pbpaste`
- `cygwin`
- [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard)
- [`xclip`](https://github.com/astrand/xclip)
- [`xsel`](http://www.kfish.org/software/xsel)
- [`lemonade`](https://github.com/pocke/lemonade)
- [`doitclient`](http://www.chiark.greenend.org.uk/~sgtatham/doit)
- `win32yank`
- [`termux-api`](https://wiki.termux.com/wiki/Termux:API)
- [`tmux`](http://tmux.github.io)
## 📥 Installation
#### 🔧 Manually
```sh
curl https://codeberg.org/NNB/cb/raw/branch/main/bin/cb > ~/.local/bin/cb
chmod +x ~/.local/bin/cb
```
#### 📦 Package manager
For [Bpkg](https://github.com/bpkg/bpkg) user:
```sh
bpkg install NNBnh/cb
```
For [Basher](https://github.com/basherpm/basher) user:
```sh
basher install NNBnh/cb
```
> **Note** If you can and want to port `cb` to other package managers, feel free to do so.
## ⌨️ Usage
Copy `STRING` to clipboard:
```sh
cb STRING
```
```sh
echo STRING | cb
```
Copy file's data to clipboard:
```sh
cb < file.txt
```
Paste from clipboard:
```sh
cb
```
Pipe clipboard string to other tool:
```sh
cb | other-tool
```
## 💌 Credits
Special thanks to:
- [**clipboard.zsh**](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh) from [Oh My Zsh](https://github.com/ohmyzsh)