diff --git a/home-environments/radio/files/.local/bin/lf/preview b/home-environments/radio/files/.local/bin/lf/preview index 2d7b482..3ce408b 100755 --- a/home-environments/radio/files/.local/bin/lf/preview +++ b/home-environments/radio/files/.local/bin/lf/preview @@ -20,8 +20,13 @@ batorcat() { fi } +mkdir -p "${XDG_CACHE_HOME}/lf" + FILE=$(readlink -f "$1") -CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$FILE" | sha256sum | awk '{print $1}')" +HASH="$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$FILE" \ + | sha256sum \ + | awk '{print $1}')" +CACHE="${XDG_CACHE_HOME}/lf/thumbnail.${HASH}" case "${FILE}" in *.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.gif|*.jfif)