mirror of
https://github.com/danbulant/nekofetch
synced 2026-06-21 23:52:17 +00:00
22 lines
511 B
Bash
Executable file
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"
|