mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03: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:
parent
56b4282009
commit
d16d20a4f5
2 changed files with 18 additions and 0 deletions
|
@ -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'
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue