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

14 lines
430 B
Bash
Executable File

#!/bin/sh
# Compare select terminal image viewers
# Args: <height> [images]...
set -x
size=10
if test $# -eq 0
then args=$DATA/4-media/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