dotfiles/.local/bin/scripts/titest

12 lines
326 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 --grid=${cols} -g $(tput cols)x$(expr $1 \* $cols) "${@:2}"
runti viu --name -h $1 "${@:2}"
runti tiv -h $1 -c $cols "${@:2}"