diff options
Diffstat (limited to 'lf/preview.sh')
-rwxr-xr-x | lf/preview.sh | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/lf/preview.sh b/lf/preview.sh index 46582bf..be52caa 100755 --- a/lf/preview.sh +++ b/lf/preview.sh @@ -1,3 +1,46 @@ #!/bin/sh -unset COLORTERM -bat --color=always --theme=base16 "$@" + +bat --paging=never --style=numbers --terminal-width $(($2-5)) -f "$1" + +# +# unset COLORTERM +# bat --color=always --theme=base16 "$@" + +# MIME=$(mimetype --all --brief "$1") +#echo "$MIME" + +# case "$MIME" in +# # .pdf +# *application/pdf*) +# pdftotext "$1" - +# ;; +# # .7z +# *application/x-7z-compressed*) +# 7z l "$1" +# ;; +# # .tar .tar.Z +# *application/x-tar*) +# tar -tvf "$1" +# ;; +# # .tar.* +# *application/x-compressed-tar*|*application/x-*-compressed-tar*) +# tar -tvf "$1" +# ;; +# # .rar +# *application/vnd.rar*) +# unrar l "$1" +# ;; +# # .zip +# *application/zip*) +# unzip -l "$1" +# ;; +# # any plain text file that doesn't have a specific handler +# *text/plain*) +# # return false to always repaint, in case terminal size changes +# bat --force-colorization --paging=never --style=changes,numbers \ +# --terminal-width $(($2 - 3)) "$1" && false +# ;; +# *) +# echo "unknown format" +# ;; +# esac |