No project description provided
Project description
Clipstream
Clipstream is a tool for printing clipboard contents to the standard output as they change. It provides a convenient way to access the system clipboard from the command line.
On a Linux system with X and the XFIXES extension, clipstream receives clipboard updates without creating processes constantly for polling.
Installation
Clipstream can be installed with pip:
pip install clipstream
For use as a command-line tool, it is recommended to use pipx to install Clipstream in its own isolated environment:
pipx install clipstream
Usage as a Command-Line Tool
Clipstream can be run from the command line with the following command:
clipstream
This will print the current contents of the clipboard to the standard output as they change.
There are several options available for customizing the output of Clipstream:
-n, --newline Print a newline after each clipboard item.
-1, --one Print one clipboard item, then exit.
-i, --include-initial Include the initial clipboard item.
-s, --strip Strip whitespace from clipboard items.
-r, --polling-rate How often to poll the clipboard, in Hz (times per second).
-0, --null Print a null byte after each clipboard item.
-u, --unique Print only unique clipboard items.
Usage as a Library
Clipstream can also be used as a library in Python projects. To use Clipstream as a library, simply import the clipboard_stream function from the clipstream.stream module:
from clipstream.stream import clipboard_stream
The clipboard_stream function returns an asynchronous generator that yields the contents of the clipboard as they change.
Examples
Here are some examples of how Clipstream can be useful as a tool:
- Downloading files from copied links:
clipstream | xargs -I_ wget _
- Writing copied text to a file:
clipstream | tee -a copied_text_file
- Get clipboard history + selector with a preview:
clipstream --strip --unique -0 | fzf --read0 --preview 'echo -n {}' --bind 'enter:execute(echo {} | xclip -selection clipboard)'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clipstream-0.1.0.tar.gz.
File metadata
- Download URL: clipstream-0.1.0.tar.gz
- Upload date:
- Size: 414.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/6.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4079f4dbef33524b3a8ba203dc543456e103d7908a4e9ed0c25eafd92171e645
|
|
| MD5 |
0129001c4bd88bd890bac766cec7c3e7
|
|
| BLAKE2b-256 |
eac0b150fd1655338e3596783f04b928f005c612f4fd1d5727959c1bf44bf81b
|
File details
Details for the file clipstream-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clipstream-0.1.0-py3-none-any.whl
- Upload date:
- Size: 545.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/6.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26072b043aab8bf465fa76fcc84182082046aed8e08dce86687bc20b676b27e5
|
|
| MD5 |
b69e9628c98ffef7ba4e0bd5760aacf7
|
|
| BLAKE2b-256 |
26a5600679c5239e01c2bc0fa90977d6fd5217c61806a353f38bbbf2ab931584
|