diff options
Diffstat (limited to 'far2l/bootstrap/view.sh')
-rwxr-xr-x | far2l/bootstrap/view.sh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/far2l/bootstrap/view.sh b/far2l/bootstrap/view.sh index 7bba89e9..dc22c311 100755 --- a/far2l/bootstrap/view.sh +++ b/far2l/bootstrap/view.sh @@ -292,10 +292,8 @@ if [[ "$FILE" == *": "*"image data, "* ]] \ || [[ "$FILE" == *": "*"SVG"*" image"* ]] \ || [[ "$FILE" == *": "*"JPEG"*" image"* ]] \ || [[ "$FILEMIME" == *": image/"* ]]; then - # ??? workaround for bash to get values of variables - bash -c "echo ${FOO}" >/dev/null 2>&1 - TCOLUMNS=$( bash -c "echo ${COLUMNS}" ) - TLINES=$( bash -c "echo ${LINES}" ) + TCOLUMNS=$( tput cols ) + TLINES=$( tput lines ) TCOLUMNS=$(( ${TCOLUMNS:-80} - 0 )) TLINES=$(( ${TLINES:-25} - 2 )) VPRETTY="no" @@ -305,7 +303,13 @@ if [[ "$FILE" == *": "*"image data, "* ]] \ TCOLUMNS=$(( ${TCOLUMNS:-80} - 1 )) chafa -c none --symbols -all+stipple+braille+ascii+space+extra --size ${TCOLUMNS}x${TLINES} "$1" >>"$2" 2>&1 echo "Image is viewed by chafa in "${TCOLUMNS}"x"${TLINES}" symbols sized area" >>"$2" 2>&1 - chafa --color-space=din99d -w 9 --symbols all --fill all "$1" && read -n1 -r -p "" >>"$2" 2>&1 + for i in $( seq $TLINES ); do echo; done + clear + DESCRIPTION="Image name, dimensions and color depth will be here soon (really soon)" + # Best settings for the fonts with limited character ranges (Consolas, Lucida Console, etc.) + #chafa -c full --color-space=din99d -w 9 --symbols solid+half+space-wide-inverted --fill all "$1" && echo -n $DESCRIPTION && read -n1 -r -p "" >>"$2" 2>&1 + # Settings for the fonts with extended character ranges (Cascadia Code, Cascadia Mono, etc.) + chafa --color-space=din99d -w 9 --symbols all --fill all "$1" && echo -n $DESCRIPTION && read -n1 -r -p "" >>"$2" 2>&1 clear elif command -v timg >/dev/null 2>&1; then |