Metadata-Version: 2.4
Name: pipedrag
Version: 0.1.1
Summary: Drag files found on the command line into any app that accepts drops
Author: jan
License-Expression: GPL-3.0-or-later
Keywords: xdnd,wayland,drag-and-drop,cli,xdg,portal
Classifier: Environment :: X11 Applications
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Desktop Environment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PySide6<7,>=6.10.2
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

# pipedrag

Drag files found on the command line into any app that accepts drops:

    find ~/Downloads -name '*.pdf' | pipedrag

`pipedrag` reads file paths from stdin (newline- or NUL-separated), opens a
small window with a multi-file icon, and lets you drag it into Dolphin, a
browser, a chat window … as if you had selected the files in a file manager.

Drops can be chunked (`pipedrag -n 1000`), most browser uploads have some sort of limit.
Chunks already dropped are marked as "green".

```bash
$> find . -name '*.jpeg' -type f | pipedrag -n 1000
```

![screenshot1.png](https://git.jtheuer.de/pipedrop/raw/branch/main/doc/screenshot1.png)

# How to install a release version

## Install as python image

    pip install pipedrag

## Debian / Ubuntu

Download the latest release from https://git.jtheuer.de/pipedrop/releases and install
it via

    sudo dpkg -i <filename.deb>
    

# Development and contribution

    make setup          # creates .venv and installs the project + dev tools

Requires Python ≥ 3.10. If `python3 -m venv` fails on Debian/Ubuntu, install
`python3-venv` first.

## How the drop works

- The drag speaks XDND — the same protocol Dolphin uses — via
  `text/uri-list`.
- The dragged files are registered with the FileTransfer portal, so
  sandboxed targets (snap/Flatpak apps) can read them even from directories
  their sandbox blocks directly — e.g. snap Firefox silently denies dot-directories
  like `~/.local/share/`. This is the same mechanism KDE/Dolphin uses.

## Drop inspector

`upload-test.html` is a browser page that prints everything the browser
exposes about dropped files (metadata, mime types, filesystem handle) and
their SHA-256/SHA-384/SHA-512 checksums — useful for verifying a drop end
to end and cross-checking with `sha256sum`.

## Notes

- The drag starts from inside the mouse-press handler, as Qt requires on
  Wayland.
  
## AI transparency

This project was largely coded via claude using the deepseek api.
I couldn't have built a QT app so quickly and the drag'n'drop part
with the portals was a lot more messy than expected.

