From 7b1f3d05570df2b3a9d2a8b0ef7a25f7bf927f87 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 26 May 2024 22:04:07 +0100 Subject: [PATCH] add csv previews to file_previewer --- file_previewer.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/file_previewer.sh b/file_previewer.sh index b0aaecc..08026b8 100755 --- a/file_previewer.sh +++ b/file_previewer.sh @@ -33,16 +33,19 @@ case "$(mimetype --brief -- "$file")" in exiftool -Picture -b "$file" | chafa --size="$(($width-4))"x"$height" --animate off || chafa cover.* --size="$(($width-4))"x"$height" --animate off exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;; + image/*) + chafa "$file" --size="$(($width-4))"x"$height" --animate off + exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;; + + text/csv) + column --separator "," --table "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;; + video/*) ffmpeg -ss 00:00:00 -i "$file" -frames:v 1 -q:v 2 "$preview_image" chafa "$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 exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;; - image/*) - chafa "$file" --size="$(($width-4))"x"$height" --animate off - exiftool "$file" | bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization;; - *) bat --theme='base16' --terminal-width "$(($width-4))" --force-colorization "$file" esac