55 lines
1.3 KiB
Bash
Executable File
55 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# ufetch-arch - tiny system info for arch
|
|
|
|
## INFO
|
|
|
|
# user is already defined
|
|
host="$(cat /etc/hostname)"
|
|
os='Synology'
|
|
kernel="$(uname -sr)"
|
|
uptime="$(uptime -p | sed 's/up //')"
|
|
packages="$(opkg list-installed | wc -l)"
|
|
shell="$(basename "$SHELL")"
|
|
|
|
## UI DETECTION
|
|
|
|
ui='DSM'
|
|
uitype='UI'
|
|
|
|
## DEFINE COLORS
|
|
|
|
# probably don't change these
|
|
if [ -x "$(command -v tput)" ]; then
|
|
bold="$(tput bold)"
|
|
black="$(tput setaf 0)"
|
|
red="$(tput setaf 1)"
|
|
green="$(tput setaf 2)"
|
|
yellow="$(tput setaf 3)"
|
|
blue="$(tput setaf 4)"
|
|
magenta="$(tput setaf 5)"
|
|
cyan="$(tput setaf 6)"
|
|
white="$(tput setaf 7)"
|
|
reset="$(tput sgr0)"
|
|
fi
|
|
|
|
# you can change these
|
|
lc="${reset}${bold}${blue}" # labels
|
|
nc="${reset}${bold}${blue}" # user and hostname
|
|
ic="${reset}" # info
|
|
c0="${reset}${blue}" # first color
|
|
|
|
## OUTPUT
|
|
|
|
cat <<EOF
|
|
${c0} _____ ${reset}
|
|
${c0} / ____| ${nc}${USER}${ic}@${nc}${host}${reset}
|
|
${c0}| (___ _ _ ${lc}OS: ${ic}${os}${reset}
|
|
${c0} \___ \| | | | ${lc}KERNEL: ${ic}${kernel}${reset}
|
|
${c0} ____) | |_| | ${lc}UPTIME: ${ic}${uptime}${reset}
|
|
${c0}|_____/ \__, | ${lc}PACKAGES: ${ic}${packages}${reset}
|
|
${c0} __/ | ${lc}SHELL: ${ic}${shell}${reset}
|
|
${c0} |___/ ${lc}${uitype}: ${ic}${ui}${reset}
|
|
|
|
EOF
|