🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

clipboard-processor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

0.3.1
PyPI
Maintainers
1

clipboard-processor

CI Build

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.

demo gif

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

Check out the autogenerated demo text which contains example strings for most supported inputs.

Functionality

Input

There are different input modes available:

ModeDescription
autoUse pyperclip for cross-platform clipboard access. This is the default.
xclip-primaryUse 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.

PluginDescriptionExternal library
aws-account-idShow AWS account name for given AWS account ID by parsing ~/.aws/config-
base64Decode base64 strings-
cronPrint human readable description of cron expressionscron-descriptor
hex-utf8Decode printable UTF-8 strings from hexadecimal representation-
jwtDecode JSON web tokens (JWTs)PyJWT
ouiShow vendor name for given MAC address or OUI (see IEEE OUI database)netaddr
ulidParse ULIDs and show the encoded timestamppython-ulid
unixtimeParse UNIX timestamps and show the human-readable (ISO 8601) time-
vinDecode Vehicle Identification Numbers (VINs)vininfo
well-knownShow explanation for well known "magic" strings.

Output

There are different output modes available:

ModeDescription
uiUse tkinter overlay near the current mouse position to show the output. This is the default.
notifyUse desktop-notifier to show the output in a desktop notification.
stdoutPrint 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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts