radio: files: lf: Make sure ${XDG_CACHE_HOME}/lf exists

impermanence
Luis Guilherme Coelho 2024-08-08 03:18:01 -03:00
parent d63425c074
commit 545e8ee5fe
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 6 additions and 1 deletions

View File

@ -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)