mirror of
https://github.com/danbulant/nekofetch
synced 2026-07-05 11:00:48 +00:00
Make debug messages oneline
This commit is contained in:
parent
9fe6aca8c2
commit
7ff9cf1d59
1 changed files with 4 additions and 12 deletions
16
nekofetch
16
nekofetch
|
|
@ -4,29 +4,21 @@ tmpfile="$(mktemp nekofetchXXXXXXXX)"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"--nsfw"|"nsfw"|"-n"|"n")
|
"--nsfw"|"nsfw"|"-n"|"n")
|
||||||
if [ "$DEBUG" = true ]; then
|
[ "$DEBUG" = "true" ] && echo "Getting a nsfw image"
|
||||||
echo "Getting a nsfw image"
|
|
||||||
fi
|
|
||||||
imgurl="https://nekos.life/api/v2/img/cum_jpg"
|
imgurl="https://nekos.life/api/v2/img/cum_jpg"
|
||||||
;;
|
;;
|
||||||
"--sfw"|"sfw"|"-s"|"s")
|
"--sfw"|"sfw"|"-s"|"s")
|
||||||
if [ "$DEBUG" = true ]; then
|
[ "$DEBUG" = "true" ] && echo "Getting a sfw image"
|
||||||
echo "Getting a sfw image"
|
|
||||||
fi
|
|
||||||
imgurl="https://nekos.life/api/v2/img/neko"
|
imgurl="https://nekos.life/api/v2/img/neko"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ "$DEBUG" = true ]; then
|
[ "$DEBUG" = "true" ] && echo "Could not interpret as either sfw or nsfw. Defaulting to sfw."
|
||||||
echo "Could not interpret as either sfw or nsfw. Defaulting to sfw."
|
|
||||||
fi
|
|
||||||
imgurl="https://nekos.life/api/v2/img/neko"
|
imgurl="https://nekos.life/api/v2/img/neko"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$2" | grep -qE '^[0-9]+$' && height="$2" || height="$(($(stty size | awk '{print $1}') - 5))"
|
echo "$2" | grep -qE '^[0-9]+$' && height="$2" || height="$(($(stty size | awk '{print $1}') - 5))"
|
||||||
if [ "$DEBUG" = true ]; then
|
[ "$DEBUG" = "true" ] && echo "Using height $height"
|
||||||
echo "Using height $height"
|
|
||||||
fi
|
|
||||||
|
|
||||||
url=$(curl -fsSL "$imgurl" | jq -r ".url")
|
url=$(curl -fsSL "$imgurl" | jq -r ".url")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue