summaryrefslogtreecommitdiffstats
path: root/.config/lf/scope
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2023-02-08 13:36:07 -0500
committerLuke Smith <luke@lukesmith.xyz>2023-02-08 13:36:07 -0500
commita489302b7431c654cc871602fb61cf9f1f09d35b (patch)
tree55cb86b00781e202492523a8aad48debf947ada4 /.config/lf/scope
parentb35102679a980bd081509e20f3f488d4415745da (diff)
parent88748a48006af4e8ec5185336cfeea3aa8f64f63 (diff)
downloadeibhear-a489302b7431c654cc871602fb61cf9f1f09d35b.tar.gz
eibhear-a489302b7431c654cc871602fb61cf9f1f09d35b.tar.zst
eibhear-a489302b7431c654cc871602fb61cf9f1f09d35b.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice
Diffstat (limited to '.config/lf/scope')
-rwxr-xr-x.config/lf/scope3
1 files changed, 3 insertions, 0 deletions
diff --git a/.config/lf/scope b/.config/lf/scope
index 1d83527..87b560a 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 ;;