aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2024-01-02 16:37:09 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2024-01-02 17:05:26 +0100
commit4c4d9d895a3cc502ce68f07022e1c4c28a703920 (patch)
treed6f4857c17e0cf4c52e702cc727e1b692764444a /games
parentf2c745de664f8cc0592a66b0663bb2869e7f1467 (diff)
downloadscripts-4c4d9d895a3cc502ce68f07022e1c4c28a703920.tar.gz
scripts-4c4d9d895a3cc502ce68f07022e1c4c28a703920.zip
Quick fix to showKingdom.sh
Diffstat (limited to 'games')
-rwxr-xr-xgames/dominion/showKingdom.sh6
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$||'