lf: clean up preview
This commit is contained in:
parent
faf4613719
commit
6e2e0d6d89
|
@ -8,7 +8,7 @@ RED="\033[31m"
|
||||||
RESET="\033[0m"
|
RESET="\033[0m"
|
||||||
RS="$(printf "\037")"
|
RS="$(printf "\037")"
|
||||||
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}')"
|
||||||
BAT="bat --style=plain --color=always --italic-text=always --pager=never --tabs=4 --theme=base16 --line-range=":$h" --terminal-width="$((w - 2))""
|
BAT="bat --style=plain --color=always --italic-text=always --pager=never --tabs=4 --theme=base16 --line-range=:$h --terminal-width=$((w - 2))"
|
||||||
CHAFA="chafa -f sixel -s ${w}x${h} --polite on --animate false"
|
CHAFA="chafa -f sixel -s ${w}x${h} --polite on --animate false"
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
|
@ -28,10 +28,10 @@ run() {
|
||||||
cached_text() {
|
cached_text() {
|
||||||
if [ -f "$CACHE" ]; then
|
if [ -f "$CACHE" ]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
$BAT $BAT_ARGS "$CACHE"
|
$BAT "$CACHE"
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
run "$@" | tee -p "$CACHE" | $BAT $BAT_ARGS
|
run "$@" | tee -p "$CACHE" | $BAT
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue