3 # ufetch-gentoo - tiny system info for gentoo
7 # user is already defined
10 host="$(cat /sys/devices/virtual/dmi/id/product_name) $(cat /sys/devices/virtual/dmi/id/product_family)"
12 uptime="$(uptime -p | sed 's/up //')"
13 packages="$(ls -d /var/db/pkg/*/* | wc -l)"
14 shell="$(basename "${SHELL}")"
21 wm="$(tail -n 1 "${f}" 2> /dev/null | cut -d ' ' -f 2)"
22 [ -n "${wm}" ] && echo "${wm}" && return
26 rcwm="$(parse_rcs "${HOME}/.xinitrc" "${HOME}/.xsession")"
30 if [ -n "${DE}" ]; then
33 elif [ -n "${WM}" ]; then
36 elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then
37 ui="${XDG_CURRENT_DESKTOP}"
39 elif [ -n "${DESKTOP_SESSION}" ]; then
40 ui="${DESKTOP_SESSION}"
42 elif [ -n "${rcwm}" ]; then
45 elif [ -n "${XDG_SESSION_TYPE}" ]; then
46 ui="${XDG_SESSION_TYPE}"
49 ui="$(basename "${ui}")"
53 # probably don't change these
54 if [ -x "$(command -v tput)" ]; then
56 black="$(tput setaf 0)"
58 green="$(tput setaf 2)"
59 yellow="$(tput setaf 3)"
60 blue="$(tput setaf 4)"
61 magenta="$(tput setaf 5)"
62 cyan="$(tput setaf 6)"
63 white="$(tput setaf 7)"
67 # you can change these
68 lc="${reset}${bold}${magenta}" # labels
69 nc="${reset}${bold}${white}" # user and hostname
71 c0="${reset}${bold}${magenta}" # first color
72 c1="${reset}${magenta}" # second color
78 ${nc}${USER}${ic}@${nc}${hostname}${reset}
79 ${c0} .-----. ${lc}OS: ${ic}${os}${reset}
80 ${c0} .\` _ \`. ${lc}KERNEL: ${ic}${kernel}${reset}
81 ${c0} \`. (${c1}_) ${c0}\`. ${lc}HOST: ${ic}${host}${reset}
82 ${c0} \`${c1}. / ${lc}UPTIME: ${ic}${uptime}${reset}
83 ${c1} .\` .\` ${lc}PACKAGES: ${ic}${packages}${reset}
84 ${c1} / .\` ${lc}${uitype}: ${ic}${ui}${reset}
85 ${c1} \____.-\` ${lc}TERM: ${ic}${term}${reset}