Skip to content

Python script to copy from STD to your clipboard with OSC 52.

License

Notifications You must be signed in to change notification settings

hammerill/oscopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oscopy

Python script to copy from STD to your clipboard with OSC 52.

How to Use It

You simply pipe to it, then you can paste whatever you piped:

echo coucou_yopta | oscopy
# now you can paste "coucou_yopta" everywhere

Important

This works even if you're connected to a remote SSH server. The content will travel through SSH and arrive in your local system clipboard.

Attention though, the echo adds a trailing newline. You can strip it with oscopy -s:

echo precision | oscopy -s
# now you can paste "precision" knowing it won't add a newline

Why not piping file contents?

cat ~/.ssh/id_rsa.pub | oscopy
# then paste your SSH pubkey on the website...

If you want you can just pass your text as args, not piping anything:

oscopy Yes, I can do this.
# this makes "Yes, I can do this." magically appear in your clipboard

Install

Install as an uv tool from this GitHub repo:

uv tool install git+https://github.com/hammerill/oscopy

Or local dev install:

# in oscopy project folder
uv tool install -e .

About

Python script to copy from STD to your clipboard with OSC 52.

Topics

Resources

License

Stars

Watchers

Forks

Languages