mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
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:
@@ -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";
|
||||
|
||||
13
pkgs/by-name/ct/ctpv/use-polite-flag.patch
Normal file
13
pkgs/by-name/ct/ctpv/use-polite-flag.patch
Normal 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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user