Drop
Drag files onto the island. While they hover, its outline turns to the accent and it says to drop them. Once dropped, it names what came, like “3 PDFs” or “report.pdf”, and offers what fits:
| Action | For | With |
|---|---|---|
| Compress | anything | zip, or bsdtar |
| Extract | zip, tar, tar.gz and other archives, 7z, rar | bsdtar, or unzip, tar and 7z |
| Merge PDFs | two PDFs or more, in the order dropped | pdfunite (poppler), or qpdf |
| Copy paths | anything | wl-copy |
| Open | anything, up to 10 files | xdg-open |
Under Convert to, a button for each format the files convert to:
| From | To | With |
|---|---|---|
| PNG, JPEG, WebP, GIF, BMP, TIFF | PNG, JPEG, WebP, GIF, BMP, TIFF, ICO | nothing: Mochi converts them itself |
| HEIC, AVIF | the same | ImageMagick (magick) |
| images | SVG, traced into shapes | vtracer |
| images | ImageMagick | |
| videos | MP4, WebM, MKV, GIF, MP3 (the sound) | ffmpeg |
| sound | MP3, Ogg, FLAC, WAV | ffmpeg |
| Word, Writer, Excel, PowerPoint files | PDF, Word, ODT, HTML | LibreOffice (soffice) |
| documents, Markdown, HTML | Markdown, Word, ODT, HTML | pandoc |
| archives: ZIP, 7z, tar and compressed tars, RAR to read | ZIP, 7z, tar, tar.gz, tar.xz, tar.zst | bsdtar (libarchive) for all of them; or unzip, tar and 7z to read and zip, tar and 7z to write, with gzip, xz and zstd for the compressed tars |
When videos are dropped, a row of video encoders sits under the formats: Auto, which lets ffmpeg pick, then the ones your ffmpeg has, like H.264, HEVC, AV1 and VP9 on the CPU, and NVIDIA’s or AMD’s when such a GPU is in the machine. The one picked goes to every conversion to a file it fits: H.264 in MP4 or MKV, VP9 in WebM; for the others ffmpeg picks. video_encoder sets the one it starts with.
A JPEG has no transparency, so transparent pixels land on white; an icon is at most 256 pixels a side. An archive converts by extracting into a scratch folder next to it and packing that again, so the new one holds the same files and folders; the scratch folder goes once it’s done, or when you stop it.
While an action runs, a bubble next to the island shows what the files are and a ring that fills as it goes, from ffmpeg’s own progress for videos and sound; the panel can close meanwhile. Resting the pointer on the bubble says what it’s doing and how far, and a click opens the panel again. There, Stop, or mochi ipc drop stop, ends it: the program it runs is killed, and what it made, finished or half written, is removed. The dropped files are never touched. When it finishes with the panel closed, the island says how it went.
When something dropped needs a program that isn’t installed, the panel says which, like “Install ffmpeg to convert videos”, and the other files still convert: an image and a video dropped together still offer GIF for the image.
An action shows only when a program for it is installed; mochi doctor lists the ones missing. New files go next to the first dropped one, and never over an old one: a second Archive.zip becomes Archive 2.zip, and an archive extracts into a new folder named after it. After an action, the island says what it made, with Show to open its folder, and closes a few seconds later. Escape closes it sooner.
# Drop: files dragged onto the island. It names what came and offers the
# actions that fit.
[module.drop]
# The video encoder conversions start with, like "libx264", "libsvtav1" or
# "h264_nvenc" for NVIDIA's; Default lets ffmpeg pick. The panel lists the ones
# your ffmpeg has, and one that doesn't fit the file, like H.264 in WebM,
# gives way to ffmpeg's pick.
# video_encoder = ""
# The actions to offer: zip (with zip or bsdtar), extract (bsdtar, unzip,
# tar or 7z), merge for PDFs (pdfunite or qpdf), convert, copy for the
# paths (wl-copy) and open (xdg-open). Images convert between PNG, JPEG,
# WebP, GIF, BMP, TIFF and ICO in Mochi itself; to SVG with vtracer, and
# HEIC, AVIF and images to PDF with ImageMagick. Videos and sound convert
# with ffmpeg, documents with LibreOffice, Markdown and HTML with pandoc,
# and archives between ZIP, 7z and the tars with bsdtar, or unzip, tar, zip
# and 7z.
# actions = ["zip", "extract", "merge", "convert", "copy", "open"]
mochi ipc drop files takes paths or file:// URIs, one a line, to do the same from a script:
mochi ipc drop files "$(printf '%s\n' "$PWD"/*.pdf)"
mochi ipc drop run merge