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

12 lines
334 B
Bash
Executable File

#!/bin/bash
# Compare select terminal image viewers
# Args: <height> [images]...
runti() {
which "$1" >/dev/null &&
highlight "$*" && "$@"
}
cols="$(expr $(tput cols) / $1 / 4 \| 1)"
runti timg --title --grid=${cols} -g $(tput cols)x$(expr $1 \* $cols) "${@:2}"
runti viu --name -h $1 "${@:2}"
runti tiv -h $1 -c $cols "${@:2}"