From c16cc2b11d36915fb381e1c8887fd7f1afbcbcf7 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 16 May 2024 13:29:07 +0200 Subject: [PATCH] fix previews --- .config/lf/preview/preview | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.config/lf/preview/preview b/.config/lf/preview/preview index 53bf3ec8a..aa8912d88 100755 --- a/.config/lf/preview/preview +++ b/.config/lf/preview/preview @@ -19,16 +19,15 @@ image() { } video() { - thumb="$("$HOME/.config/lf/preview/vidthumb" "$f")" || ( + thumb="$("$HOME/.config/lf/preview/vidthumb" "$f")" || { printf "%b" "${RED}vidthumb failed to execute${RESET}" return 1 - ) + } image "$thumb" } text() { - bat --color=always --style=plain --pager=never --terminal-width "$((w - 2))" "$f" && exit 1 - cat "$f" + bat --color=always --style=plain --pager=never --terminal-width "$((w - 2))" "$@" "$f" exit 1 } @@ -93,7 +92,7 @@ if command -v gio 1>/dev/null 2>&1; then fi case "$(file -b "$f")" in - *text*) text "$f" ;; + *text*) text ;; *) printf "%b" "\$(file --mime-type)\t\t\t : $filerun\n" [ -n "$giorun" ] && printf "%b" "\$(gio info)\t\t\t\t : $giorun\n"