From f8243aab24310da7fd3614356a006ce8bb0bed30 Mon Sep 17 00:00:00 2001 From: sxored <80121803+sxored@users.noreply.github.com> Date: Sat, 27 Mar 2021 15:36:00 +0600 Subject: [PATCH] added chafa to view pictures --- far2l/bootstrap/view.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/far2l/bootstrap/view.sh b/far2l/bootstrap/view.sh index 0e9cfa89..35f38a44 100755 --- a/far2l/bootstrap/view.sh +++ b/far2l/bootstrap/view.sh @@ -25,6 +25,12 @@ if [[ "$FILE" == *ELF*executable* ]] || [[ "$FILE" == *ELF*object* ]]; then fi if [[ "$FILE" == *"JPEG image"* ]]; then + if command -v chafa >/dev/null 2>&1; then + chafa -c 16 --color-space=din99d -w 9 --symbols all --fill all "$1" && read -n1 -r -p "" >>"$2" 2>&1 + exit 0 + else + echo "Install to see picture" >>"$2" 2>&1 + fi if command -v jp2a >/dev/null 2>&1; then jp2a --colors "$1" >>"$2" 2>&1 exit 0 @@ -34,6 +40,12 @@ if [[ "$FILE" == *"JPEG image"* ]]; then fi if [[ "$FILE" == *" image data, "* ]]; then + if command -v chafa >/dev/null 2>&1; then + chafa -c 16 --color-space=din99d -w 9 --symbols all --fill all "$1" && read -n1 -r -p "" >>"$2" 2>&1 + exit 0 + else + echo "Install to see picture" >>"$2" 2>&1 + fi if command -v asciiart >/dev/null 2>&1; then asciiart -c "$1" >>"$2" 2>&1 else -- 2.11.4.GIT