ctpv: fix img previews and correct dependency

Add missing pdf preview dependency. `ctpv` uses `pdftoppm` [1] to
preview pdf files. Required dependency was not included on the last PR
targeting `ctpv`, although it added the tools for other ftypes [2].

Fix chafa image privews by passing the missing flag via a patch. This
comes from a year long bug fix PR open at upstream, for details refer
there [3].

[1]: 4efa0f976e/README.md (L58)
[2]: github:NixOS/nixpkgs#223487
[3]: github:NikitaIvanovV/ctpv#90
This commit is contained in:
octvs 2025-05-01 13:32:56 +02:00
parent 56b4282009
commit d16d20a4f5
No known key found for this signature in database
GPG key ID: 726720A1131FB640
2 changed files with 18 additions and 0 deletions

View file

@ -15,6 +15,7 @@
glow,
imagemagick,
jq,
poppler-utils,
ueberzug,
}:
@ -52,11 +53,15 @@ stdenv.mkDerivation rec {
glow # for markdown files
imagemagick
jq # for json files
poppler-utils # for pdf files
ueberzug # for image files on X11
]
}";
'';
# Until https://github.com/NikitaIvanovV/ctpv/pull/90 is merged
patches = [ ./use-polite-flag.patch ];
meta = with lib; {
description = "File previewer for a terminal";
homepage = "https://github.com/NikitaIvanovV/ctpv";

View file

@ -0,0 +1,13 @@
diff --git a/sh/helpers.sh b/sh/helpers.sh
index fef8691..229d38f 100644
--- a/sh/helpers.sh
+++ b/sh/helpers.sh
@@ -73,7 +73,7 @@ is_anim_image() {
chafa_run() {
format='-f symbols'
autochafa && format=
- chafasixel && format='-f sixels'
+ chafasixel && format='-f sixels --polite on'
chafa -s "${w}x${h}" $format "$1" | sed 's/#/\n#/g'
}