lf: clean up preview
This commit is contained in:
parent
faf4613719
commit
6e2e0d6d89
|
@ -8,7 +8,7 @@ RED="\033[31m"
|
|||
RESET="\033[0m"
|
||||
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}')"
|
||||
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"
|
||||
|
||||
run() {
|
||||
|
@ -28,10 +28,10 @@ run() {
|
|||
cached_text() {
|
||||
if [ -f "$CACHE" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
$BAT $BAT_ARGS "$CACHE"
|
||||
$BAT "$CACHE"
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
run "$@" | tee -p "$CACHE" | $BAT $BAT_ARGS
|
||||
run "$@" | tee -p "$CACHE" | $BAT
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue