From 88bcaeb8b87ec78953c0633a5519dfd2e50af8aa Mon Sep 17 00:00:00 2001 From: krolyxon Date: Mon, 13 Feb 2023 20:48:06 +0530 Subject: add support for avif in lf --- .config/lf/scope | 3 +++ 1 file changed, 3 insertions(+) (limited to '.config/lf/scope') diff --git a/.config/lf/scope b/.config/lf/scope index 2b7ffa2..2ec0c4e 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -22,6 +22,9 @@ ifub() { # be regenerated once seen. case "$(file --dereference --brief --mime-type -- "$1")" in + image/avif) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" + [ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg" + image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;; text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;; text/troff) man ./ "$1" | col -b ;; -- cgit v1.2.3