Process clipboard content and show helpful overlays or notifications based on the content, e.g. parse UNIX timestamps, AWS account IDs, VINs, base64 strings and more.
Project description
clipboard-processor
Process clipboard content and show helpful overlays or notifications based on the content, e.g. parse UNIX timestamps, AWS account IDs, VINs, base64 strings and more.
All parsing & decoding is done locally. The clipboard content is not sent to any external service.
Installation
Quickstart
Install into userspace, create a userspace systemd service & enable it (via installer script):
curl -L -o install-clipboard-processor https://raw.githubusercontent.com/tom-mi/clipboard-processor/main/scripts/install
# review & adapt the installer as needed
chmod +x install-clipboard-processor
./install-clipboard-processor
Manual installation
Some features require additional libraries to be installed (see below).
Install with required dependencies only:
pip install clipboard-processor
Install with all optional dependencies (recommended):
pip install clipboard-processor[all]
Usage
clipboard-processor
Show help:
clipboard-processor --help
Run with xclip-primary input mode:
clipboard-processor --input xclip-primary
Functionality
Input
There are different input modes available:
| Mode | Description |
|---|---|
auto |
Use pyperclip for cross-platform clipboard access. This is the default. |
xclip-primary |
Use the primary selection on linux via xclip. No explicit copy operation is needed – selecting the text is sufficient. Requires xclip command in the search path. |
Plugins
All decoding functionality is provided via plugins. Per default, all available plugins are enabled.
| Plugin | Description | External library |
|---|---|---|
aws-account-id |
Show AWS account name for given AWS account ID by parsing ~/.aws/config |
- |
base64 |
Decode base64 strings | - |
cron |
Print human readable description of cron expressions | cron-descriptor |
hex-utf8 |
Decode printable UTF-8 strings from hexadecimal representation | - |
jwt |
Decode JSON web tokens (JWTs) | PyJWT |
oui |
Show vendor name for given MAC address or OUI (see IEEE OUI database) | netaddr |
ulid |
Parse ULIDs and show the encoded timestamp | python-ulid |
unixtime |
Parse UNIX timestamps and show the human-readable (ISO 8601) time | - |
vin |
Decode Vehicle Identification Numbers (VINs) | vininfo |
well-known |
Show explanation for well known "magic" strings. |
Output
There are different output modes available:
| Mode | Description |
|---|---|
ui |
Use tkinter overlay near the current mouse position to show the output. This is the default. |
notify |
Use desktop-notifier to show the output in a desktop notification. |
stdout |
Print the result of the processing to the standard output. This is mostly intended for debugging and testing. |
Development
This project uses Hatch for managing the development environment.
Prerequisites
Install xvfb for running the snapshot tests.
TODO: some more effort might be necessary to support Windows and macOS.
Run all tests
hatch test --all
hatch run test-minimal:run
hatch run test-snapshot:run
Create environment for IntelliJ
Create a development environment in .venv/ which can easily be used by IntelliJ or other IDEs:
hatch env create dev
Run development version
hatch shell
clipboard-processor
or
hatch run clipboard-processor
Troubleshooting
In case dependencies are not synced into an existing env, try removing all environments:
hatch env prune
Release a new version
Draft a new release on GitHub.
Project details
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 clipboard_processor-0.3.0.tar.gz.
File metadata
- Download URL: clipboard_processor-0.3.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07ea085c9c8dfe89fa5dea52fa6e4030ced84341f7bbe0e18f1c20240a6e5235
|
|
| MD5 |
3032c72576e3fcbd94bfd709437a4320
|
|
| BLAKE2b-256 |
63ccd29dd6badb58b1e7255773236707df59ee796032de5561a2b9d88f40e1c8
|
Provenance
The following attestation bundles were made for clipboard_processor-0.3.0.tar.gz:
Publisher:
release.yml on tom-mi/clipboard-processor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipboard_processor-0.3.0.tar.gz -
Subject digest:
07ea085c9c8dfe89fa5dea52fa6e4030ced84341f7bbe0e18f1c20240a6e5235 - Sigstore transparency entry: 209331519
- Sigstore integration time:
-
Permalink:
tom-mi/clipboard-processor@99dcd164b3b17fff2de71dda639f22abfd4c7227 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tom-mi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@99dcd164b3b17fff2de71dda639f22abfd4c7227 -
Trigger Event:
release
-
Statement type:
File details
Details for the file clipboard_processor-0.3.0-py3-none-any.whl.
File metadata
- Download URL: clipboard_processor-0.3.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
741d323a7c4458e73cd9733d293eed4d841e5c0b01ec3d99da01c98396bf5e41
|
|
| MD5 |
451c7b506249478df3f3054fbe952910
|
|
| BLAKE2b-256 |
eda627a4b60f91fe870164f4522ed6811e145996e4aedcae85404fbe0348f26f
|
Provenance
The following attestation bundles were made for clipboard_processor-0.3.0-py3-none-any.whl:
Publisher:
release.yml on tom-mi/clipboard-processor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipboard_processor-0.3.0-py3-none-any.whl -
Subject digest:
741d323a7c4458e73cd9733d293eed4d841e5c0b01ec3d99da01c98396bf5e41 - Sigstore transparency entry: 209331526
- Sigstore integration time:
-
Permalink:
tom-mi/clipboard-processor@99dcd164b3b17fff2de71dda639f22abfd4c7227 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tom-mi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@99dcd164b3b17fff2de71dda639f22abfd4c7227 -
Trigger Event:
release
-
Statement type: