30 lines
655 B
Bash
Executable file
30 lines
655 B
Bash
Executable file
#!/bin/sh
|
|
width="$1"
|
|
file="$2"
|
|
i=0
|
|
clear
|
|
|
|
|
|
printf "\n\n\n"
|
|
printf " "
|
|
while [ "$i" -lt $( expr "$width" / 2) ]
|
|
do
|
|
printf " "
|
|
i=$( expr "$i" + 1 )
|
|
done
|
|
|
|
if [ -z $DISPLAY ] ; then
|
|
chafa --work=1 -s 40x40 --animate=off -c 256 --symbols ascii "$file"
|
|
sleep 10
|
|
exit
|
|
fi
|
|
|
|
|
|
if [ -z "$TERM256" ] ; then
|
|
#chafa --work=1 --animate=off -c full -f sixels --bg blue "$file"
|
|
chafa --work=1 --animate=off -c 256 -f sixels --bg blue "$file"
|
|
else
|
|
#chafa --work=1 -s 32x32 --animate=off -c 256 -f symbols --bg blue "$file"
|
|
chafa --work=1 --animate=off -c 256 -f symbols --bg blue "$file"
|
|
fi
|
|
pkill chafa #make sure it's dead and not hogging resources
|