3 # ufetch-alpine - tiny system info for alpine
7 # user is already defined
11 uptime
="$(uptime | awk -F, '{sub(".
*up
",x,$1);print $1}' | sed -e 's/^[ \t]*//')"
12 packages
="$(apk info | wc -l)"
13 shell
="$(basename "${SHELL}")"
19 wm
="$(tail -n 1 "${f}" 2> /dev/null | cut -d ' ' -f 2)"
20 [ -n "${wm}" ] && echo "${wm}" && return
24 rcwm
="$(parse_rcs "${HOME}/.xinitrc
" "${HOME}/.xsession
")"
28 if [ -n "${DE}" ]; then
31 elif [ -n "${WM}" ]; then
34 elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then
35 ui
="${XDG_CURRENT_DESKTOP}"
37 elif [ -n "${DESKTOP_SESSION}" ]; then
38 ui
="${DESKTOP_SESSION}"
40 elif [ -n "${rcwm}" ]; then
43 elif [ -n "${XDG_SESSION_TYPE}" ]; then
44 ui
="${XDG_SESSION_TYPE}"
47 ui
="$(basename "${ui}")"
62 # you can change these
63 lc
="${reset}${bold}${blue}" # labels
64 nc
="${reset}${bold}${blue}" # user and hostname
66 c0
="${reset}${blue}" # first color
71 ${c0} /\\ ${nc}${USER}${ic}@${nc}${host}${reset}
72 ${c0} / \\ ${lc}OS: ${ic}${os}${reset}
73 ${c0} / /\\ \\ /\\ ${lc}KERNEL: ${ic}${kernel}${reset}
74 ${c0} / / \\ \\/ \\ ${lc}UPTIME: ${ic}${uptime}${reset}
75 ${c0} / / \\ \\/\\ \\ ${lc}PACKAGES: ${ic}${packages}${reset}
76 ${c0} / / /| \\ \\ \\ \\ ${lc}SHELL: ${ic}${shell}${reset}
77 ${c0} /_/ /_| \\_\\ \\_\\ ${lc}${uitype}: ${ic}${ui}${reset}