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

clipboard-many-files

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipboard-many-files

Place several files on clipboard from the command-line

1.0.1
PyPI
Maintainers
1

clipboard-many-files

@readwithai - X - blog - machine-assisted reading

A command-line tool to copy several files to the clipboard as though you copied them from a file browser.

At present, this tool only supports Linux (both X11 and wayland). This tool requires xclip if you are using X11 or wl-clipboard if you are using Wayland.

Motivation

You can copy and paste multiple images from file browsers such as Dolphin in KDE to many applications such as wordprocessors and browsers. It is useful to be able to do this from the command-line and within scripts

I could not find any command-line tools to this, despite it being fairly straight-forward when you understand the protocol used. I decided to implement this in a standard way and share it in an easy-to-use form.

Alternatives and prior work

Most file browsers support copy-and-pasting multiple files.

It is fairly straightforward to do this manually by setting the text/uri-list target in the clipboard to a new-line separated list of entries file URL scheme. Any user familiar with bash could create a shell script on their path to do so. This tool, however, removes the need to maintain such as script, and can easily be installed on any system.

Attribution

I made use of this approach of converting paths to URLs.

When reviewing clipbaord libraries, I found some of the code of pyperclip informative for implementing wayland functionality.

Caveats

I wrote and tested this tool on Linux and this is the only operating system supported at the moment. Patches adding support to other operating systems are much appreciated and will be quickly merged.

I use a couple of command-line tools to access the clipboard. I could find no python library which supported setting targets and reading the code for xclip communicating with X11 directly is probably more effort that this involved. Klembord seems to have this option - but has been archived and when I tested this functionality on X11 it did not work.

Support

If you found this tool useful, you could give me $1 on my ko-fi. This will incentivize me to respond to issues with this project and create similar tools.

You can also support this project by looking at similar tools that I have created or reviewing my work related to reading and research.

About me

I am @readwithai. I create tools for reading, research and agency, sometimes using Obsidian.

I also tend to produce a stream of tools related to my work.

I post about both on X. I write more about reading and research on my blog.

[@readwithai logo][https://x.com/readwithai]

Keywords

clipboard

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