nekofetch/nekofetch
2020-12-26 15:36:09 -06:00

22 lines
511 B
Bash
Executable file

#!/bin/sh
required="neofetch jp2a jq"
for req in $required; do
! command -v "$req" > /dev/null 2>&1 && echo "$req not found!" && exit 1
done
tmpfile="$(mktemp -p /tmp nekofetchXXXXXXXX)"
if [ "$1" = "--nsfw" ]; then
url=$(curl -fsSL "https://nekos.life/api/v2/img/cum_jpg" | jq -r ".url")
else
url=$(curl -fsSL "https://nekos.life/api/v2/img/neko" | jq -r ".url")
fi
curl -fsSLo "$tmpfile.jpg" "$url"
jp2a "$tmpfile.jpg" > "$tmpfile"
neofetch --source "$tmpfile"
rm "$tmpfile" "$tmpfile.jpg"