diff options
Diffstat (limited to 'modules/by-name')
-rw-r--r-- | modules/by-name/lf/lf/ctpv/prev/any.sh | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/modules/by-name/lf/lf/ctpv/prev/any.sh b/modules/by-name/lf/lf/ctpv/prev/any.sh index 9eb3a422..7209fccb 100644 --- a/modules/by-name/lf/lf/ctpv/prev/any.sh +++ b/modules/by-name/lf/lf/ctpv/prev/any.sh @@ -8,9 +8,51 @@ f="$f" . %HELPERS +# FIXME: Fix the problem, that `???.log.gpg` won't trigger the gpg +# preview, as `cptv` thinks, the extension is `log.gpg` <2024-11-24> +# +# # Before running things on the last extension, ctpv tries to run a preview on the full +# # extension. Therefore, we need to filter these out, to allow the real display to run on +# # them. +# +# full_extension="${f#*.}" +# +# # contains(string, substring) +# # +# # Returns 0 if the specified string contains the specified substring, +# # otherwise returns 1. +# contains() { +# string="$1" +# substring="$2" +# if [ "${string#*"$substring"}" != "$string" ]; then +# return 0 # $substring is in $string +# else +# return 1 # $substring is not in $string +# fi +# } +# +# if contains "$full_extension" "."; then +# sub_extension="${full_extension#*.}" +# base_extension="${full_extension%.*}" +# +# case "$base_extension" in +# "tar") +# # delegate to the archive tool +# exit 127 +# ;; +# esac +# +# case "$sub_extension" in +# "gpg" | "sig" | "key" | "cert" | "asc") +# # delegate to the gpg tool +# exit 127 +# ;; +# esac +# fi + if exiftool "$f" >/dev/null 2>&1; then exiftool -- "$f" else - # Exiftool did not recognize the file. + # `exiftool` did not recognize the file. xxd -- "$f" fi |