From 545e8ee5fee1e6989a2748cad6701611f98982a4 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Thu, 8 Aug 2024 03:18:01 -0300 Subject: [PATCH] radio: files: lf: Make sure ${XDG_CACHE_HOME}/lf exists --- home-environments/radio/files/.local/bin/lf/preview | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)