3 # ufetch-openbsd - tiny system info for openbsd
7 # user is already defined
11 uptime
="$(uptime | awk -F, '{sub(".
*up
",x,$1);print $1}' | sed -e 's/^[ \t]*//')"
12 packages
="$(ls -d /var/db/pkg/* | wc -l | sed -e 's/^[ \t]*//')"
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}")"
51 # probably don't change these
52 if [ -x "$(command -v tput)" ]; then
53 bold
="$(tput bold 2> /dev/null)"
54 black
="$(tput setaf 0 2> /dev/null 0 0 2>/dev/null)"
55 red
="$(tput setaf 1 2> /dev/null 0 0 2>/dev/null)"
56 green
="$(tput setaf 2 2> /dev/null 0 0 2>/dev/null)"
57 yellow
="$(tput setaf 3 2> /dev/null 0 0 2>/dev/null)"
58 blue
="$(tput setaf 4 2> /dev/null 0 0 2>/dev/null)"
59 magenta
="$(tput setaf 5 2> /dev/null 0 0 2>/dev/null)"
60 cyan
="$(tput setaf 6 2> /dev/null 0 0 2>/dev/null)"
61 white
="$(tput setaf 7 2> /dev/null 0 0 2>/dev/null)"
62 reset="$(tput sgr0 2> /dev/null)"
65 # you can change these
66 lc
="${reset}${bold}${yellow}" # labels
67 nc
="${reset}${bold}${yellow}" # user and hostname
69 c0
="${reset}${yellow}" # first color
70 c1
="${reset}${white}" # second color
71 c2
="${reset}${bold}${yellow}" # third color
77 ${c0} _____ ${nc}${USER}${ic}@${nc}${host}${reset}
78 ${c0} \- -/ ${lc}OS: ${ic}${os}${reset}
79 ${c0} \_/ \ ${lc}KERNEL: ${ic}${kernel}${reset}
80 ${c0} | ${c1}O O ${c0}| ${lc}UPTIME: ${ic}${uptime}${reset}
81 ${c0} |_ ${c2}< ${c0}) ${c2}3 ${c0}) ${lc}PACKAGES: ${ic}${packages}${reset}
82 ${c0} / \ / ${lc}SHELL: ${ic}${shell}${reset}
83 ${c0} /-_____-\ ${lc}${uitype}: ${ic}${ui}${reset}