Add kitty image backend support (detects kitty)

This commit is contained in:
BBaoVanC 2021-01-11 08:46:17 -06:00
parent 26613ace6d
commit 1ef8ac1e54
No known key found for this signature in database
GPG key ID: 18089E4E3CCF1D3A

View file

@ -23,7 +23,11 @@ echo "Using height $height"
url=$(curl -fsSL "$imgurl" | jq -r ".url")
curl -fsSLo "$tmpfile.jpg" "$url"
jp2a --height="$height" "$tmpfile.jpg" > "$tmpfile"
neofetch --source "$tmpfile"
if [ "$TERM" = "xterm-kitty" ]; then
neofetch --kitty "$tmpfile.jpg"
else
jp2a --height="$height" "$tmpfile.jpg" > "$tmpfile"
neofetch --source "$tmpfile"
fi
rm "$tmpfile" "$tmpfile.jpg"