3 # ufetch-arch - tiny system info for arch
7 # user is already defined
8 host="$(cat /etc/hostname)"
11 uptime="$(uptime -p | sed 's/up //')"
12 packages="$(pacman -Q | wc -l)"
13 shell="$(basename "$SHELL")"
17 if [ -n "${DE}" ]; then
20 elif [ -n "${WM}" ]; then
23 elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then
24 ui="${XDG_CURRENT_DESKTOP}"
26 elif [ -n "${DESKTOP_SESSION}" ]; then
27 ui="${DESKTOP_SESSION}"
29 elif [ -f "${HOME}/.xinitrc" ]; then
30 ui="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)"
32 elif [ -f "${HOME}/.xsession" ]; then
33 ui="$(tail -n 1 "${HOME}/.xsession" | cut -d ' ' -f 2)"
39 ui="$(basename ${ui})"
43 # probably don't change these
44 if [ -x "$(command -v tput)" ]; then
46 black="$(tput setaf 0)"
48 green="$(tput setaf 2)"
49 yellow="$(tput setaf 3)"
50 blue="$(tput setaf 4)"
51 magenta="$(tput setaf 5)"
52 cyan="$(tput setaf 6)"
53 white="$(tput setaf 7)"
57 # you can change these
58 lc="${reset}${bold}${blue}" # labels
59 nc="${reset}${bold}${blue}" # user and hostname
61 c0="${reset}${blue}" # first color
67 ${c0} /\\ ${nc}${USER}${ic}@${nc}${host}${reset}
68 ${c0} / \\ ${lc}OS: ${ic}${os}${reset}
69 ${c0} /\\ \\ ${lc}KERNEL: ${ic}${kernel}${reset}
70 ${c0} / __ \\ ${lc}UPTIME: ${ic}${uptime}${reset}
71 ${c0} / ( ) \\ ${lc}PACKAGES: ${ic}${packages}${reset}
72 ${c0} / __| |__\\\\ ${lc}SHELL: ${ic}${shell}${reset}
73 ${c0} /.\` \`.\\ ${lc}${uitype}: ${ic}${ui}${reset}