diff options
author | Ivan Shatsky <root@free-tier-instance.us-west1-b.c.neural-map-305409.internal> | 2022-11-09 18:03:38 +0300 |
---|---|---|
committer | Ivan Shatsky <root@free-tier-instance.us-west1-b.c.neural-map-305409.internal> | 2022-11-09 18:03:38 +0300 |
commit | 89d2196de63acaaec18d72518ebcea5e5392f8f0 (patch) | |
tree | 96b067b67941d759a95ca2462d9036278739090c | |
parent | f2a164feb0ce9ae222a9bd1bcfdb6cfbbc5fcd03 (diff) |
Revert "Correct screen resolution calculation, improved image output"
This reverts commit f2a164feb0ce9ae222a9bd1bcfdb6cfbbc5fcd03.
More work needed with this
-rwxr-xr-x | far2l/bootstrap/view.sh | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/far2l/bootstrap/view.sh b/far2l/bootstrap/view.sh index dc22c311..7bba89e9 100755 --- a/far2l/bootstrap/view.sh +++ b/far2l/bootstrap/view.sh @@ -292,8 +292,10 @@ if [[ "$FILE" == *": "*"image data, "* ]] \ || [[ "$FILE" == *": "*"SVG"*" image"* ]] \ || [[ "$FILE" == *": "*"JPEG"*" image"* ]] \ || [[ "$FILEMIME" == *": image/"* ]]; then - TCOLUMNS=$( tput cols ) - TLINES=$( tput lines ) + # ??? 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=$(( ${TCOLUMNS:-80} - 0 )) TLINES=$(( ${TLINES:-25} - 2 )) VPRETTY="no" @@ -303,13 +305,7 @@ 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 - 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 + chafa --color-space=din99d -w 9 --symbols all --fill all "$1" && read -n1 -r -p "" >>"$2" 2>&1 clear elif command -v timg >/dev/null 2>&1; then |