From c7da73112e35242d060e8e8276a0859f826da67f Mon Sep 17 00:00:00 2001 From: Christian <75549110+propruhh@users.noreply.github.com> Date: Sat, 26 Dec 2020 15:14:12 -0600 Subject: [PATCH] add nekofetch script --- nekofetch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 nekofetch diff --git a/nekofetch b/nekofetch new file mode 100644 index 0000000..2a1c86f --- /dev/null +++ b/nekofetch @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ ! command -v jp2a &> /dev/null ]; then + echo "jp2a not found!" + exit 1 +fi + +if [ ! command -v neofetch &> /dev/null ]; then + echo "neofetch not found!" + exit 1 +fi + +if [ ! command -v jq &> /dev/null ]; then + echo "jq not found!" + exit 1 +fi + +[[ ! -d "/tmp/nekofetch" ]] && mkdir /tmp/nekofetch + +if [[ "$1" = "--nsfw" ]]; then + url=$(curl "https://nekos.life/api/v2/img/cum_jpg" | jq -r ".url") + curl -fsSLo "/tmp/nekofetch/neko.jpg" "$url" + + jp2a /tmp/nekofetch/neko.jpg > /tmp/nekofetch/neko + neofetch --source /tmp/nekofetch/neko +else + url=$(curl "https://nekos.life/api/v2/img/neko" | jq -r ".url") + curl -fsSLo "/tmp/nekofetch/neko.jpg" "$url" + + jp2a /tmp/nekofetch/neko.jpg > /tmp/nekofetch/neko + neofetch --source /tmp/nekofetch/neko +fi