bin/b: alternatively use catimg since timg is only in debian testing

This commit is contained in:
xeruf 2022-07-20 21:06:15 +01:00
parent 48d9b3f7bd
commit fe63972fba
1 changed files with 11 additions and 4 deletions

View File

@ -62,6 +62,7 @@ for arg; do
fi fi
continue continue
fi fi
# amount of columns in a grid
grid=$(expr $(tput cols) / \( 25 - \( $# / 2 \) \& $# \< 30 \| 5 \)) grid=$(expr $(tput cols) / \( 25 - \( $# / 2 \) \& $# \< 30 \| 5 \))
tmpfile="$prefix/$(basename "$arg")" tmpfile="$prefix/$(basename "$arg")"
mkdir -p "$prefix" mkdir -p "$prefix"
@ -135,10 +136,16 @@ done
# timga: potentially viewable as image # timga: potentially viewable as image
if test "$timg"; then if test "$timg"; then
# TODO Don't show info on all images for gifs # TODO Don't show info on all images for gifs
$inspect || $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \ $inspect ||
if which timg
then $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \
$(test $# -gt 1 && $(test $# -gt 1 &&
echo "-t0.2 --center $(test $# -lt 20 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \ echo "-t0.2 --center $(test $# -lt 20 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \
"${timg[@]}" "${timga[@]}" 2>/dev/null || true "${timg[@]}" "${timga[@]}" 2>/dev/null || true
else for img in "${timg[@]}"
do catimg -H $(expr $(tput lines) / 2) $img
done
fi
if which identify && ( $inspect || test $# -lt 10 ); then if which identify && ( $inspect || test $# -lt 10 ); then
tput setaf 6 tput setaf 6
for img in "${timg[@]}" for img in "${timg[@]}"