Clipboard Capture for Linux, it can capture the contents of clipboard (or primary selection)

Overview

clipcap

Clipboard Capture for Linux, it can capture the contents of clipboard (or primary selection), as it changes when the program is running and print it to stdout. You can also choose to run some command on each capture.

For e.g. running with arguments ~-p -c “notify-send”~ will send notification each time you select something.

Made to replace and add more functionality to:

Features

  • print captured contents to stdout with custom deliminator,
  • run command for each capture,
  • support for primary selection along with clipboard.
  • save the capture to a file, (or append)
  • filter the capture by a regex pattern

Demo

Demo showing simple capture and primary capture.

./images/clipcap-demo-clip.gif

Demo showing Capture filtering, command execution and fix number of captures.

./images/clipcap-demo-pattern.gif

Usage Flags

append

-a, --append Do not clear output file before writing to it Use with -o flag, writes the new contents at the end of the output file.

command

-c, --command Command to run on each entry [default: ] Runs the given command for each capture. The command should just be the name of a binary in your path or path to a script. The script cannot take arguments, so make a script that takes single argument (capture content).

filter

-f, --filter Filter the capture to matching regex pattern [default: ] Filters the capture, only the capture that contain the given filter will be captured and others will be discarded. It is from the regex crate.

help

-h, --help Print help information

count

-n, --count Only capture this many times, 0 for infinity [default: 0] To be used in scripts to not make programs wait forever. It’ll end after COUNT capture.

output

-o, --output Output File to write the captured contents [default: ] File to write the capture to, use -a flag with this to append instead.

primary

-p, --primary Use Primary Selection instead of Clipboard (Linux) For Linux it can capture the primary selection so you don’t have to copy the text. Most useful for me, specially to highlight words and use -c to send that word to dictionary.

quiet

-q, --quiet Do not print anything to stdout, ignores `separator`

refresh-rate

-r, --refresh-rate Refresh Rate in miliseconds [default: 200] checked It is how often the clipboard content is checked, too often means you’ll have high CPU usage, too infrequent and you might miss something. You probably aren’t super faster, so put a reasonable time.

separator

-s, --separator Separator between two entries for output [default: "\n"] some Separator between the capture, if capturing some co-ordinates or some values you can put something like ~”, “~ or sth.

Notes

The command can only be proper command, so if you want to run something complex make a script file that only takes one argument and make that script executable and pass it as command.

I made this for dictionary search. So my use-case is just selecting one word to run the command for dictionary to get that word, so I haven’t tested for variety of scenarios.

Future plans

Config file to write templates, like ‘notify’ template will have notify-send command. The templates should be able to have position for captured text instead of adding it at the end like now.

Templates should be able to make a lot of things easier, as well as a default.

You might also like...
MyCitadel Wallet app for Linux, Windows & MacOS desktop made with GTK+
MyCitadel Wallet app for Linux, Windows & MacOS desktop made with GTK+

MyCitadel Desktop Bitcoin, Lightning and RGB wallet MyCitadel is a wallet for bitcoin, digital assets and bitcoin finance (#BiFi) smart contracts. It

Manage lockfiles in PKGBUILDs for upstreams that don't ship them, `updpkgsums` for dependency trees (Arch Linux tooling)

updlockfiles Manage lockfiles for packages that don't ship any upstream. Like updpkgsums but for 3rd party dependency trees. If you're not actively ma

VVVVVV autosplitter for macOS and Linux

Vitellary Vitellary is a work-in-progress autosplitter for VVVVVV v2.3.6 on macOS and Linux systems. More notes here soon when it’s done. Thanks / See

Nostr Vanity Address Generator (Windows, Linux and macOS)

Nostr Vanity Address Generator CLI tool to generate vanity addresses for Nostr Usage Download the latest release built by GitHub CI from the releases

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Windows Capture Simple Screen Capture for Windows 🔥

Windows Capture   Windows Capture is a highly efficient Rust library that enables you to effortlessly capture the screen using the Graphics Capture AP

Transparency for Mining Pool Transaction Selection

miningpool-observer Transparency for Mining Pool Transaction Selection The miningpool-observer project compares block templates produced by a Bitcoin

Maximum Relevance - Minimum redundancy feature selection algorithm

mrmr Maximum Relevance - Minimum redundancy feature selection algorithm implemented in Rust. Usage CLI app. It gets input from a csv dataset with head

A grub theme in the style of the Minecraft singleplayer (sp) world selection screen!

Minecraft World Selection Grub Theme Wowie, another Minecraft grub theme! But this time it's in the style of the singleplayer world selection menu, wh

secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process.

secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process. More specifically, the crate disables core dumps and tries to disable tracing on unix-like OSes.

A zero-copy parser for the contents of the __unwind_info section of a mach-O binary.

A parser for Apple's Compact Unwinding Format, which is used in the __unwind_info section of mach-O binaries.

Remote-Archive is a utility for exploring remote archive files without downloading the entire contents of the archive.

[WIP] REMOTE-ARCHIVE Remote-Archive is a utility for exploring remote archive files without downloading the entire contents of the archive. The idea b

A tool for investigating file system and folder contents and their changes.

Sniff A tool for investigating file systems and folder contents and their changes. Sniff can create snapshots of file systems and folders, storing has

A Zellij plugin to fuzzy find file names and contents in style 🧐
A Zellij plugin to fuzzy find file names and contents in style 🧐

About This Zellij plugin is a fuzzy finder for file names and their contents. It can open results in your $EDITOR (scrolled to the correct line), as f

A filesystem driver that allows you to view your Blackboard course contents as if they were normal files and folders on your system!
A filesystem driver that allows you to view your Blackboard course contents as if they were normal files and folders on your system!

BlackboardFS Blackboard: noun A website so bad that it might as well be a network drive. BlackboardFS is a filesystem driver that allows you to view y

A library to capture the Screen on Linux, MacOS and Windows.

Captis - A library for capturing the screen on Linux, MacOS and Windows It's a fairly simple library that performs good enough, the OS level APIs that

A Simple-to-use, cross-platform Rust Webcam Capture Library

Cross Platform Rust Library for powerful Webcam Capture and Virtual Webcams

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust
desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust. 基于 Rust / WASM 提供截图、取色、键鼠事件监听模拟、压缩解压、图像处理、获取已安装应用等跨平台功能的现代异步 Nodejs 模块,占用空间小, 安装便捷, 使用简单, 高性能, 资源占用极小, 可取代 iohook 和 robotjs

Comments
  • Fails with Error when the clipboard is empty (right after booting)

    Fails with Error when the clipboard is empty (right after booting)

    The following error was received when the clipcap was run with clipcap -p immediately after computer bootup.

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ContentNotAvailable - "The clipboard contents were not available in the requested format or the clipboard is empty."', src/main.rs:36:58
    

    Might need to make sure this is caught and skipped when this error is encountered, as the description looks like it'll happen also when an image is copied.

    bug 
    opened by Atreyagaurav 1
Releases(v0.1)
  • v0.1(Aug 4, 2022)

    First release version.

    Features Implemented:

    • Clipboard capture
    • Primary capture for Linux
    • quiet mode
    • output to file (overwrite/append)
    • Run commands on each capture
    • Change refresh rate between clipboard check
    • Fix number of iterations and infinite loop (default)
    Source code(tar.gz)
    Source code(zip)
    clipcap.exe(815.00 KB)
Owner
Zero
Environmental Engineer | Software Engineer
Zero
MevWallet is a smart contract wallet that allows the user to capture MEV from Searchers, or create MEV on purpose.

MevWallet MevWallet is a smart contract wallet that allows the user to capture MEV from Searchers, or create MEV on purpose. This repo contains the so

Blunt Instruments 94 Jan 26, 2023
Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs

backseat-signed Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs. This

null 25 Apr 17, 2024
A Peer-to-Peer cross-platform clipboard syncing tool.

p2p-clipboard p2p-clipboard is a Peer-to-Peer cross-platform clipboard syncing tool. It enables users to synchronize clipboard contents across multipl

null 3 Feb 28, 2024
A collection of algorithms that can do join between two parties while preserving the privacy of keys on which the join happens

Private-ID Private-ID is a collection of algorithms to match records between two parties, while preserving the privacy of these records. We present tw

Meta Research 169 Dec 5, 2022
CLI tool written in Rust which can be used to generate hashes

rustgenhash rustgenhash is a tool to generate hashes on the commandline from stdio. It can be used to generate single or multiple hashes for usage in

Volker Schwaberow 11 Dec 29, 2022
Turnstile encrypts data so that it can only be decrypted on another computer

Turnstile - One Way Encryption Turnstile encrypts data so that it can only be decrypted on another computer (and can't be decrypted on the encrypting

Faded Bee 4 May 6, 2022
Example of a SC coded in RUST that can safely perform any swaps of tokens (NFT, SFT, ESDT, MetaESDT)

Elrond-NFT-Trading Example of a Smart Contract (SC) coded in RUST, that can perform any swaps of tokens (NFT, SFT, ESDT, MetaESDT) The idea P2P swaps

Sia 3 May 17, 2022
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
An experimental fork of a16z's Helios Ethereum client which can run its network traffic over the Nym mixnet

Helios (Nym mixnet fork) Helios is a fully trustless, efficient, and portable Ethereum light client written in Rust. This fork of Helios includes nasc

Nym 4 Mar 3, 2023
An easy-to-use generic trainer for Linux, written in Rust.

An easy-to-use generic trainer for Linux written in Rust, with basic memory hacking features. Use it for your games or applications where needed, there is also the tuxtraind daemon which will probe for processes and apply matching trainers automatically.

null 37 Aug 10, 2022