lf: cleanup preview
This commit is contained in:
parent
05f3c9a9ca
commit
848825d7a0
1 changed files with 3 additions and 2 deletions
|
@ -50,6 +50,7 @@ run() {
|
||||||
printf "%b" "\n${RED} ${l}${RESET}"
|
printf "%b" "\n${RED} ${l}${RESET}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
mimetest() {
|
mimetest() {
|
||||||
|
@ -67,7 +68,7 @@ mimetest() {
|
||||||
*/pkix-cert) run openssl x509 -text -noout -in "$f" ;;
|
*/pkix-cert) run openssl x509 -text -noout -in "$f" ;;
|
||||||
*opendocument*) run odt2txt "$f" ;;
|
*opendocument*) run odt2txt "$f" ;;
|
||||||
*/markdown)
|
*/markdown)
|
||||||
[ ! -f "${CACHE}.txt" ] && run mdless "$f" --width "$w" >"${CACHE}.txt"
|
[ ! -f "${CACHE}.txt" ] && run mdless "$f" >"${CACHE}.txt"
|
||||||
text "${CACHE}.txt"
|
text "${CACHE}.txt"
|
||||||
;;
|
;;
|
||||||
*/html) run lynx -dump "$f" ;;
|
*/html) run lynx -dump "$f" ;;
|
||||||
|
@ -100,7 +101,7 @@ mimetest() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
CACHE="${XDG_CACHE_HOME}/lf/$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"
|
CACHE="${XDG_CACHE_HOME}/lf/$(stat --printf "%n\0%i\0%F\0%s\0%W\0%Y" -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"
|
||||||
|
|
||||||
# Special cases
|
# Special cases
|
||||||
[ "$(dirname "$(realpath "$f")" | rev | cut -d/ -f1 | rev)" = "factscache" ] &&
|
[ "$(dirname "$(realpath "$f")" | rev | cut -d/ -f1 | rev)" = "factscache" ] &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue