#!/bin/sh
#
# ufetch-gentoo - tiny system info for gentoo

## INFO

# user is already defined
host="$(hostname)"
os='Gentoo Linux'
kernel="$(uname -sr)"
uptime="$(uptime -p | sed 's/up //')"
packages="$(ls -d /var/db/pkg/*/* | wc -l)"
shell="$(basename ${SHELL})"
if [ -z "${WM}" ]; then
	WM="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)"
fi

## DEFINE COLORS

# probably don't change these
bold="$(tput bold)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"
reset="$(tput sgr0)"

# you can change these
lc="${reset}${bold}${magenta}"	# labels
nc="${reset}${bold}${magenta}"	# user and hostname
ic="${reset}${bold}${white}"	# info
c0="${reset}${bold}${magenta}"	# first color
c1="${reset}${magenta}"			# second color

## OUTPUT
# art from gentoo prefix project's bootstrap-prefix.sh

cat <<EOF

${c0}     .vir.       ${nc}${USER}${ic}@${nc}${host}${reset}
${c0}   .d\$\$\$\$${c1}\$\$b.    ${lc}OS:        ${ic}${os}${reset}
${c0}   \$\$\$\$${c1}( )${c0}\$${c1}\$\$b   ${lc}KERNEL:    ${ic}${kernel}${reset}
${c0}   Q\$\$\$\$\$\$\$\$${c1}\$\$B  ${lc}UPTIME:    ${ic}${uptime}${reset}
${c0}     "\$\$\$\$\$${c1}\$\$P   ${lc}PACKAGES:  ${ic}${packages}${reset}
${c0}    d\$\$\$\$${c1}\$\$P"    ${lc}SHELL:     ${ic}${shell}${reset}
${c0}  \$\$\$\$\$${c1}\$\$P       ${lc}WM:        ${ic}${WM}${reset}
${c0}  \`Q\$\$${c1}P"${reset}

EOF
