An open API service indexing awesome lists of open source software.

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)

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)


Made with <3 by NNB