Use termimage instead of chafa in file_previewer.sh
This commit is contained in:
@ -17,7 +17,7 @@ case "$(mimetype --brief -- "$file")" in
|
|||||||
jq --color-output . "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
jq --color-output . "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
application/pdf)
|
application/pdf)
|
||||||
pdftoppm -jpeg "$file" -singlefile | chafa --size="$(($width-4))"x"$height" --animate off
|
pdftoppm -jpeg "$file" -singlefile | termimage --size "$(($width-4))"x"$height"
|
||||||
pdfinfo "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
pdfinfo "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
application/vnd.sqlite3)
|
application/vnd.sqlite3)
|
||||||
@ -30,11 +30,12 @@ case "$(mimetype --brief -- "$file")" in
|
|||||||
unzip -lv "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
unzip -lv "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
audio/*)
|
audio/*)
|
||||||
exiftool -Picture -b "$file" | chafa --size="$(($width-4))"x"$height" --animate off || chafa cover.* --size="$(($width-4))"x"$height" --animate off
|
exiftool -Picture -b "$file" | termimage --size "$(($width-4))"x"$height" || termimage cover.* --size "$(($width-4))"x"$height"
|
||||||
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
image/*)
|
image/*)
|
||||||
chafa "$file" --size="$(($width-4))"x"$height" --animate off
|
termimage "$file" --size "$(($width-4))"x"$height"
|
||||||
|
# chafa "$file" --size="$(($width-4))"x"$height" --animate off
|
||||||
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
text/csv)
|
text/csv)
|
||||||
@ -42,7 +43,7 @@ case "$(mimetype --brief -- "$file")" in
|
|||||||
|
|
||||||
video/*)
|
video/*)
|
||||||
ffmpeg -ss 00:00:00 -i "$file" -frames:v 1 -q:v 2 "$preview_image"
|
ffmpeg -ss 00:00:00 -i "$file" -frames:v 1 -q:v 2 "$preview_image"
|
||||||
chafa "$preview_image" --size="$(($width-4))"x"$height"
|
termimage "$preview_image" --size "$(($width-4))"x"$height"
|
||||||
rm "$preview_image" # removing preview file so that lf looks for a new preview image instead of going for an old one
|
rm "$preview_image" # removing preview file so that lf looks for a new preview image instead of going for an old one
|
||||||
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user