Skip to content
/ cbt Public

Command-line tool that transforms new clipboard content with a series of user-defined shell filters and prints the result.

License

Notifications You must be signed in to change notification settings

Sh4pe/cbt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status crates.io

cbt - clipboard transformations

The clipboard transformer retrieves new values from the system clipboard and runs them through a series of user-defined transformations.

These transformations can be either inline shell commands like sed s/a/b/g or arbitrarily complex shell commands.

Examples

Print the current clipboard value as soon as it changes.

$ cbt

Transform as to As and bs to Bs.

$ cbt 'sed s/a/A/g' 'sed s/b/B/g'

Pretty-print JSON-content in the clipboard using jq.

$ cbt 'jq .'

Count how many words are separated by a , (works for the macOS version of sed).

$ cbt "sed 's/,/\'$'\n/g'" "wc -l"

If the clipboard content matches "foo", run it through your super-complex Python filter.

$ cbt 'grep foo' ./super_complex_filter.py

Shoot yourself in the foot with an infinite loop.

$ cbt 'xargs echo "haha "' pbcopy

Installation

Build from source locally

The source install requires that you have the Rust compiler installed. Once it is present, run:

$ git clone git@github.com:Sh4pe/cbt.git
$ cd cbt
$ cargo install

This installs cbt to your $CARGO_HOME/bin directory.

Install from crates.io

To build directly from crates.io, run:

$ cargo install cbt

About

Command-line tool that transforms new clipboard content with a series of user-defined shell filters and prints the result.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages