diff options
-rwxr-xr-x | games/dominion/showKingdom.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/games/dominion/showKingdom.sh b/games/dominion/showKingdom.sh index dd4b3a2..d5aa7cb 100755 --- a/games/dominion/showKingdom.sh +++ b/games/dominion/showKingdom.sh @@ -28,6 +28,7 @@ fi PRINT_SELECTION='' OUTPUT_AS_IMAGE='' TMP_IMAGE='showKingdom.jpg' +type 'sxiv' >/dev/null 2>&1 || OUTPUT_AS_IMAGE='y' # Process options while getopts 'oi' opt; do @@ -61,11 +62,12 @@ while read -r card; do done | if [ -n "$OUTPUT_AS_IMAGE" ]; then oldIFS="$IFS" - IFS=$'\n' + IFS="$(printf '\n.')" + IFS="${IFS%.}" montage $(cat -) -tile '5x' -mode 'concatenate' -background 'black' "$TMP_IMAGE" magick "$TMP_IMAGE" -trim "$TMP_IMAGE" sxiv "$TMP_IMAGE" || termux-open "$TMP_IMAGE" - rm "$TMP_IMAGE" + #rm "$TMP_IMAGE" # Problems on phone IFS="$oldIFS" elif [ -n "$PRINT_SELECTION" ]; then sxiv -iotb | sed 's|^/.*/||;s|_| |g;s|.jpg$||' |