preview/ holds a yazi.toml and a pdf-hidpi plugin that fix unreadable PDF previews. Yazi calls pdftoppm without -r (150 DPI) and then caps the image at 600x900, so pages are downscaled and upscaled again; the plugin renders at 300 DPI as PNG and the cap goes to 1600x2400, turning that into supersampling. Previewer and preloader both have to be overridden — they share the cache file. README documents this plus what video previews can and cannot do: the preview is a single ffmpeg keyframe by design, J/K scrubs it, and the opener offers mpv --vo=kitty with shared-memory transfer for inline playback. Targets the 26.9 plugin API (fs.cha, not main's fs.stat). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.5 KiB
TOML
39 lines
1.5 KiB
TOML
#:schema https://yazi-rs.github.io/schemas/yazi.json
|
|
|
|
[preview]
|
|
# Yazi caps every rendered preview image at these pixel dimensions before
|
|
# showing it. The default 600x900 is well below what the preview pane is worth
|
|
# on a large or a portrait screen, so PDFs and images arrive already
|
|
# downscaled and then get upscaled again — that is the blur.
|
|
max_width = 1600
|
|
max_height = 2400
|
|
|
|
# Applies to the JPEGs the video previewer produces (PDFs go through pdf-hidpi
|
|
# below, which renders PNG and ignores this).
|
|
image_quality = 90
|
|
|
|
[plugin]
|
|
# Replace the built-in PDF previewer with a high-resolution variant.
|
|
# Both entries are needed: the preloader fills the same cache file the
|
|
# previewer reads, so overriding only one of them leaves the 150 DPI version
|
|
# in place.
|
|
prepend_previewers = [
|
|
{ mime = "application/pdf", run = "pdf-hidpi" },
|
|
]
|
|
prepend_preloaders = [
|
|
{ mime = "application/pdf", run = "pdf-hidpi" },
|
|
]
|
|
|
|
[opener]
|
|
# Replaces the preset's `play` list (a list defined here is not merged).
|
|
# Audio and video use it via the built-in `[open]` rule for {audio,video}/*.
|
|
play = [
|
|
# Enter / o — normal mpv window.
|
|
{ run = "mpv %s", desc = "Play (mpv)", for = "unix", orphan = true },
|
|
# O, then pick — plays inside this terminal via the Kitty graphics
|
|
# protocol. Blocks Yazi until mpv exits; q quits.
|
|
{ run = "mpv --vo=kitty --vo-kitty-use-shm=yes %s", desc = "Play here (Kitty)", for = "unix", block = true },
|
|
# Yazi's preset also offers mediainfo here; Tab (spot) already shows
|
|
# codec, resolution and duration, so it is left out.
|
|
]
|