remove echo to tell you height/sfw/nsfw

This commit is contained in:
propruhh 2021-02-28 11:08:10 -06:00
parent 380389c254
commit 6133e79de9

View file

@ -2,23 +2,33 @@
tmpfile="$(mktemp nekofetchXXXXXXXX)"
debug=false
case "$1" in
"--nsfw"|"nsfw"|"-n"|"n")
echo "Getting a nsfw image"
if [ "$debug" == true ]; then
echo "Getting a nsfw image"
fi
imgurl="https://nekos.life/api/v2/img/cum_jpg"
;;
"--sfw"|"sfw"|"-s"|"s")
echo "Getting a sfw image"
if [ "$debug" == true ]; then
echo "Getting a sfw image"
fi
imgurl="https://nekos.life/api/v2/img/neko"
;;
*)
echo "Could not interpret as either sfw or nsfw. Defaulting to sfw."
if [ "$debug" == true ]; then
echo "Could not interpret as either sfw or nsfw. Defaulting to sfw."
fi
imgurl="https://nekos.life/api/v2/img/neko"
;;
esac
echo "$2" | grep -qE '^[0-9]+$' && height="$2" || height="$(($(stty size | awk '{print $1}') - 5))"
echo "Using height $height"
if [ "$debug" == true ]; then
echo "Using height $height"
fi
url=$(curl -fsSL "$imgurl" | jq -r ".url")