3 # ufetch-arch - tiny system info for arch
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="$(pacman -Q | 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}${blue}" # labels
69 nc="${reset}${bold}${yellow}" # user and hostname
71 c0="${reset}${cyan}" # first color
75 # ${c0} /\\ ${nc}${USER}${ic}@${nc}${hostname}${reset}
76 # ${c0} / \\ ${lc}OS: ${ic}${os}${reset}
77 # ${c0} /\\ \\ ${lc}KERNEL: ${ic}${kernel}${reset}
78 # ${c0} / __ \\ ${lc}HOST: ${ic}${host}${reset}
79 # ${c0} / ( ) \\ ${lc}UPTIME: ${ic}${uptime}${reset}
80 # ${c0} / __| |__\\\\ ${lc}PACKAGES: ${ic}${packages}${reset}
81 # ${c0} /.\` \`.\\ ${lc}SHELL: ${ic}${shell}${reset}
82 # ${lc}${uitype}: ${ic}${ui}${reset}
83 # ${bold}${red}██${green}██${yellow}██${blue}██${magenta}██${cyan}██${white}██${reset} ${lc}TERM: ${ic}${term}${reset}
85 # ${bold}${red}██${green}██${yellow}██${blue}██${magenta}██${cyan}██${white}██${reset}
89 ${c0} . ${nc}${USER}${ic}@${nc}${hostname}${reset}
90 ${c0} / \\ ${lc}OS: ${ic}${os}${reset}
91 ${c0} / \\ ${lc}KERNEL: ${ic}${kernel}${reset}
92 ${c0} /^. \\ ${lc}HOST: ${ic}${host}${reset}
93 ${c0} / .-. \\ ${lc}UPTIME: ${ic}${uptime}${reset}
94 ${c0} / ( ) _\\ ${lc}PACKAGES: ${ic}${packages}${reset}
95 ${c0} / _.~ ~._^\\ ${lc}${uitype}: ${ic}${ui}${reset}
96 ${c0} /.^ ^.\\ ${lc}TERM: ${ic}${term}${reset}