https://github.com/nnbnh/clipb
π Clipboard managers warper that SuperB
https://github.com/nnbnh/clipb
basher bpkg cli clipboard clipboard-manager copy-paste posix terminal
Last synced: 8 months ago
JSON representation
π Clipboard managers warper that SuperB
- Host: GitHub
- URL: https://github.com/nnbnh/clipb
- Owner: NNBnh
- License: gpl-3.0
- Created: 2021-02-01T15:31:21.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-26T15:19:43.000Z (over 3 years ago)
- Last Synced: 2025-04-12T09:43:19.662Z (about 1 year ago)
- Topics: basher, bpkg, cli, clipboard, clipboard-manager, copy-paste, posix, terminal
- Language: Shell
- Homepage:
- Size: 37.1 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> **π’ [Check out `cb`. It's the successor to `clipb`!](https://codeberg.org/NNB/cb)**
clipb
Clipboard managers warper that SuperB

## π‘ About
`clipb` is a *SuperB* clipboard managers warper written in [`portable sh`](https://github.com/dylanaraps/pure-sh-bible) that wraps various system-specific tools for interacting with a system clipboard.
### π Story
When switch around [Wayland](https://wayland.freedesktop.org) and [X.org](https://www.x.org), i realise my shell scripts that copy/paste text to and from clipboard are broken. So i strip the [`kakboard-autodetect` function](https://github.com/lePerdu/kakboard/blob/2f13f5cd99591b76ad5cba230815b80138825120/kakboard.kak#L98-L138) out into a standalone CLI clipboard managers warper call [`clipb`](https://github.com/NNBnh/clipb) to detect and interacting with any system clipboard.
> **Note** *Checkout [`clipb.kak`](https://github.com/NNBnh/clipb.kak), an extremely strip down fork of [Kakboard](https://github.com/lePerdu/kakboard).*
### β¨ Features
- Work with `tee` like pipeline (e.g: `ls | clipb | grep -e 'string'`)
- Supported clipboard managers are:
- [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard)
- [`xclip`](https://github.com/astrand/xclip)
- [`xsel`](http://www.kfish.org/software/xsel)
- `pbcopy`, `pbpaste`
- `cygwin`'s `/dev/clipboard`
- [`termux-api`](https://wiki.termux.com/wiki/Termux:API)
## π Setup
### π§Ύ Dependencies
- [Unix commands](https://en.wikipedia.org/wiki/List_of_Unix_commands) to process
- [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard) for [Wayland](https://wayland.freedesktop.org)
- [`xclip`](https://github.com/astrand/xclip) or [`xsel`](http://www.kfish.org/software/xsel) for [X.org](https://www.x.org)
- [`termux-api`](https://wiki.termux.com/wiki/Termux:API) for [Termux](https://termux.com)
### π₯ Installation
#### π§ Manually
Option 1: using `curl`
```sh
curl https://raw.githubusercontent.com/NNBnh/clipb/main/bin/clipb > ~/.local/bin/clipb
chmod +x ~/.local/bin/clipb
```
Option 2: using `git`
```sh
git clone https://github.com/NNBnh/clipb.git ~/.local/share/clipb
ln -s ~/.local/share/clipb/bin/clipb ~/.local/bin/clipb
```
#### π¦ Package manager
For [Bpkg](https://github.com/bpkg/bpkg) user:
```sh
bpkg install NNBnh/clipb
```
For [Basher](https://github.com/basherpm/basher) user:
```sh
basher install NNBnh/clipb
```
> **Note** *If you can and want to port Clipb to other package managers, feel free to do so.*
## β¨οΈ Usage
Copy `TEXTS` to clipboard:
```sh
clipb copy TEXTS
```
Paste from clipboard:
```sh
clipb paste
```
## π Credits
Special thanks to:
- [**Kakboard**](https://github.com/lePerdu/kakboard) by [Zach Peltzer](https://github.com/lePerdu)
- [**Vis-clipboard**](https://github.com/martanne/vis) by [Marc AndrΓ© Tanner](https://github.com/martanne)
---
>
Made with β€οΈ by NNB
>
>