The Clipboard Transformer is a simple tool that allows you to transform the text in your clipboard by running a compiled binary that takes your current clipboard as stdin and returns the new, transformed output over stdout.
It includes a GTK GUI that allows you to pick from a list of transformations and run them with the press of a button (or the enter key).
| macOS | Ubuntu |
|---|---|
![]() |
![]() |
-
Ensure that git submodules are initialized and updated, and install gtk:
git submodule update --init --recursive sudo apt install libgtk-3-dev
-
Build the project:
cmake ./build cmake --build ./build
-
Install transformations: wherever the binary is, make a subdirectory called
transformationsand put compiled binaries inside. -
Run the program:
./build/clipboard-transformer
- Copy some text to your clipboard.
- Run the program.
- Pick a transformation from the dropdown menu.
- Press enter to run the transformation.
- Paste the transformed text.
- Repeat steps 3-5 as needed.
Since transformations are just binaries that take stdin and return stdout, you can test them by running them directly:
$ echo "hello world" | ./transformations/uppercase
HELLO WORLDOn macOS, you can use pbpaste and pbcopy to test transformations on the command line using your real clipboard:
# old clipboard: hello world
$ pbpaste | ./transformations/uppercase | pbcopy
# new clipboard: HELLO WORLDTransformations are written in any language that can be compiled to a binary. The binary should take the current
clipboard
text as stdin and return the transformed text over stdout. The binary should be placed in the transformations
directory
in the same directory as the clipboard transformer binary.
There are some C-language examples in the transformations directory, but here's an example that uppercases text in a
few compiled languages:
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
reader := bufio.NewReader(os.Stdin)
text, _ := reader.ReadString('\n')
text = strings.ToUpper(text)
fmt.Print(text)
}Compile with go build -o uppercase uppercase.go.
#include <iostream>
#include <cctype>
#include <string>
int main() {
std::string input;
std::getline(std::cin, input);
for (char& c : input) {
c = std::toupper(c);
}
std::cout << input << std::endl;
return 0;
}
Compile with g++ -o uppercase uppercase.cpp.
#include <iostream>
#include <cctype>
#include <string>
int main() {
std::string input;
std::getline(std::cin, input);
for (char& c : input) {
c = std::toupper(c);
}
std::cout << input << std::endl;
return 0;
}Compile with rustc uppercase.rs.

