mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-06-21 02:18:24 +02:00
Minor
This commit is contained in:
parent
0da19f7c37
commit
402e4aa932
14
prev/pdf.sh
14
prev/pdf.sh
@ -1,10 +1,10 @@
|
|||||||
pdf() {
|
pdf() {
|
||||||
pdftoppm -f 1 -l 1 \
|
pdftoppm -f 1 -l 1 \
|
||||||
-scale-to-x 1920 \
|
-scale-to-x 1920 \
|
||||||
-scale-to-y -1 \
|
-scale-to-y -1 \
|
||||||
-singlefile \
|
-singlefile \
|
||||||
-jpeg -tiffcompression jpeg \
|
-jpeg -tiffcompression jpeg \
|
||||||
-- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f"
|
-- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f"
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_and_show_image pdf
|
convert_and_show_image pdf
|
||||||
|
31
prev/text.sh
31
prev/text.sh
@ -1,24 +1,27 @@
|
|||||||
if exists bat; then
|
if exists bat; then
|
||||||
batcmd=bat
|
batcmd=bat
|
||||||
elif exists batcat; then
|
elif exists batcat; then
|
||||||
batcmd=batcat
|
batcmd=batcat
|
||||||
else
|
else
|
||||||
batcmd=
|
batcmd=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$batcmd" ]; then
|
if [ -n "$batcmd" ]; then
|
||||||
"$batcmd" --color always \
|
"$batcmd" \
|
||||||
--style plain \
|
--color always \
|
||||||
--paging never \
|
--style plain \
|
||||||
--terminal-width "$w" \
|
--paging never \
|
||||||
--wrap character \
|
--terminal-width "$w" \
|
||||||
-- "$f"
|
--wrap character \
|
||||||
|
-- "$f"
|
||||||
elif exists highlight; then
|
elif exists highlight; then
|
||||||
highlight --replace-tabs=4 --out-format=ansi \
|
highlight \
|
||||||
--style='pablo' --force -- "$f"
|
--replace-tabs=4 --out-format=ansi \
|
||||||
|
--style='pablo' --force -- "$f"
|
||||||
elif exists source-highlight; then
|
elif exists source-highlight; then
|
||||||
source-highlight --tab=4 --out-format=esc \
|
source-highlight \
|
||||||
--style=esc256.style --failsafe -i "$f"
|
--tab=4 --out-format=esc \
|
||||||
|
--style=esc256.style --failsafe -i "$f"
|
||||||
else
|
else
|
||||||
cat "$f"
|
cat "$f"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user