clipbread is a Node.js app that allows transforming the content of the clipboard using user-defined JavaScript functions or, optionally, their aliases.
It can be used directly in the terminal:
# Using the name of the functions...
clipbread trim toUpperCase singleQuote
# ...or their (user-defined) aliases
clipbread t tuc sq
It can also be piped to an external tool like fzf, rofi, dmenu, Alfred (with PowerPack), etc. for convenience and speed. See wrappers for reference.
clipbread comes with few examples in its config file, but it's intended to be
customized by you, the user. Start by executing clipbread -i
to copy the
config files to your $HOME
.
Check my config for inspiration.
Q: My custom function is not being executed in the wrapper, what do?
A: Run clipbread in a terminal in case it's throwing an error, then check how to
debug in the docs of the wrapper you're using/piping to.
Q: Does this work with bun or deno?
A: Yes, but you'll have to make changes in the scripts. I did a very basic check
for the lulz, but I don't use those regularly.
Q: I don't know how to program, can I still use this?
A: Sure, ask ChatGPT or any other AI to write a function to do what you want to
achieve, and paste it in your config file.
Q: Why didn't you write this on TypeScript, Rust, Cobol, a napkin?
A: Yes.
Q: Seriously, JavaScript sucks.
A: I know.