diff --git a/prev/pdf.sh b/prev/pdf.sh index 3e9b146..f01c745 100644 --- a/prev/pdf.sh +++ b/prev/pdf.sh @@ -1,10 +1,10 @@ pdf() { - pdftoppm -f 1 -l 1 \ - -scale-to-x 1920 \ - -scale-to-y -1 \ - -singlefile \ - -jpeg -tiffcompression jpeg \ - -- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f" -} + pdftoppm -f 1 -l 1 \ + -scale-to-x 1920 \ + -scale-to-y -1 \ + -singlefile \ + -jpeg -tiffcompression jpeg \ + -- "$f" "$cache_f" && mv -- "$cache_f.jpg" "$cache_f" + } convert_and_show_image pdf diff --git a/prev/text.sh b/prev/text.sh index 7223ef2..9461dc1 100644 --- a/prev/text.sh +++ b/prev/text.sh @@ -1,24 +1,27 @@ if exists bat; then - batcmd=bat + batcmd=bat elif exists batcat; then - batcmd=batcat + batcmd=batcat else - batcmd= + batcmd= fi if [ -n "$batcmd" ]; then - "$batcmd" --color always \ - --style plain \ - --paging never \ - --terminal-width "$w" \ - --wrap character \ - -- "$f" + "$batcmd" \ + --color always \ + --style plain \ + --paging never \ + --terminal-width "$w" \ + --wrap character \ + -- "$f" elif exists highlight; then - highlight --replace-tabs=4 --out-format=ansi \ - --style='pablo' --force -- "$f" + highlight \ + --replace-tabs=4 --out-format=ansi \ + --style='pablo' --force -- "$f" elif exists source-highlight; then - source-highlight --tab=4 --out-format=esc \ - --style=esc256.style --failsafe -i "$f" + source-highlight \ + --tab=4 --out-format=esc \ + --style=esc256.style --failsafe -i "$f" else - cat "$f" + cat "$f" fi