mirror of
https://github.com/danbulant/nekofetch
synced 2026-06-24 17:11:49 +00:00
Add warning message for kitty image backend for missing imagemagick
This commit is contained in:
parent
122bfa73f7
commit
9ed99828f8
1 changed files with 8 additions and 2 deletions
10
nekofetch
10
nekofetch
|
|
@ -23,11 +23,17 @@ echo "Using height $height"
|
||||||
url=$(curl -fsSL "$imgurl" | jq -r ".url")
|
url=$(curl -fsSL "$imgurl" | jq -r ".url")
|
||||||
|
|
||||||
curl -fsSLo "$tmpfile.jpg" "$url"
|
curl -fsSLo "$tmpfile.jpg" "$url"
|
||||||
if [ "$TERM" = "xterm-kitty" ] && command -v convert > /dev/null 2>&1; then
|
if [ "$TERM" = "xterm-kitty" ]; then
|
||||||
neofetch --kitty "$tmpfile.jpg"
|
command -v convert > /dev/null 2>&1 && neofetch --kitty "$tmpfile.jpg" || kitty_imagemagick_warn=true
|
||||||
|
if [ "$kitty_imagemagick_warn" = "true" ]; then
|
||||||
|
jp2a --height="$height" "$tmpfile.jpg" > "$tmpfile"
|
||||||
|
neofetch --source "$tmpfile"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
jp2a --height="$height" "$tmpfile.jpg" > "$tmpfile"
|
jp2a --height="$height" "$tmpfile.jpg" > "$tmpfile"
|
||||||
neofetch --source "$tmpfile"
|
neofetch --source "$tmpfile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm "$tmpfile" "$tmpfile.jpg"
|
rm "$tmpfile" "$tmpfile.jpg"
|
||||||
|
|
||||||
|
[ "$kitty_imagemagick_warn" = "true" ] && echo "WARN: imagemagick is required for kitty image backend"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue