dotfiles/.local/bin/scripts/test-tiv

14 lines
422 B
Plaintext
Raw Normal View History

#!/bin/sh
2021-11-06 23:28:57 +00:00
# Compare select terminal image viewers
# Args: <height> [images]...
set -x
size=10
if test $# -eq 0
then args=$DATA/images/*.png
else echo "$1" | grep -v -e "\." -e "/" && size=$1 && shift
fi
cols="$(expr $(tput cols) / $size / 3 \| 1)"
timg --rotate=exif --title --grid=${cols} -g $(tput cols)x$(expr $size \* $cols + 4) "$@" $args
viu --name -h $size "$@" $args
tiv -h $size -c $(expr $cols + 1) "$@" $args