mirror of
https://gitlab.com/jschx/ufetch.git
synced 2026-10-01 05:52:34 +07:00
Add ufetch-devuan and fix colors on ufetch-alpine
This commit is contained in:
+12
-16
@@ -39,19 +39,16 @@ fi
|
||||
|
||||
## 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
|
||||
bold='\033[1m'
|
||||
black='\033[0;30m'
|
||||
red='\033[0;31m'
|
||||
green='\033[0;32m'
|
||||
yellow='\033[0;33m'
|
||||
blue='\033[0;34m'
|
||||
magenta='\033[0;35m'
|
||||
cyan='\033[0;36m'
|
||||
white='\033[0;37m'
|
||||
reset='\033[0m'
|
||||
|
||||
# you can change these
|
||||
lc="${reset}${bold}${blue}" # labels
|
||||
@@ -61,8 +58,7 @@ c0="${reset}${blue}" # first color
|
||||
|
||||
## OUTPUT
|
||||
|
||||
cat <<EOF
|
||||
|
||||
printf "
|
||||
${c0} /\\ ${nc}${USER}${ic}@${nc}${host}${reset}
|
||||
${c0} / \\ ${lc}OS: ${ic}${os}${reset}
|
||||
${c0} / /\\ \\ /\\ ${lc}KERNEL: ${ic}${kernel}${reset}
|
||||
@@ -71,4 +67,4 @@ ${c0} / / \\ \\/\\ \\ ${lc}PACKAGES: ${ic}${packages}${reset}
|
||||
${c0} / / /| \\ \\ \\ \\ ${lc}SHELL: ${ic}${shell}${reset}
|
||||
${c0} /_/ /_| \\_\\ \\_\\ ${lc}${uitype}: ${ic}${ui}${reset}
|
||||
|
||||
EOF
|
||||
"
|
||||
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ufetch-devuan - tiny system info for devuan
|
||||
|
||||
## INFO
|
||||
|
||||
# user is already defined
|
||||
host="$(hostname)"
|
||||
os="Devuan $(cat /etc/debian_version)"
|
||||
kernel="$(uname -sr)"
|
||||
uptime="$(uptime -p | sed 's/up //')"
|
||||
packages="$(dpkg -l | grep -c ^i)"
|
||||
shell="$(basename "$SHELL")"
|
||||
|
||||
## UI DETECTION
|
||||
|
||||
if [ -n "${DE}" ]; then
|
||||
ui="${DE}"
|
||||
uitype='DE'
|
||||
elif [ -n "${WM}" ]; then
|
||||
ui="${WM}"
|
||||
uitype='WM'
|
||||
elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then
|
||||
ui="${XDG_CURRENT_DESKTOP}"
|
||||
uitype='DE'
|
||||
elif [ -n "${DESKTOP_SESSION}" ]; then
|
||||
ui="${DESKTOP_SESSION}"
|
||||
uitype='DE'
|
||||
elif [ -f "${HOME}/.xinitrc" ]; then
|
||||
ui="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)"
|
||||
uitype='WM'
|
||||
elif [ -f "${HOME}/.xsession" ]; then
|
||||
ui="$(tail -n 1 "${HOME}/.xsession" | cut -d ' ' -f 2)"
|
||||
uitype='WM'
|
||||
elif [ -h /etc/alternatives/x-session-manager ]; then
|
||||
ui="$(update-alternatives --query x-session-manager | awk -F'/' '/Value/{print $4}')"
|
||||
uitype='DE'
|
||||
elif [ -h /etc/alternatives/x-window-manager ]; then
|
||||
ui="$(update-alternatives --query x-window-manager | awk -F'/' '/Value/{print $4}')"
|
||||
uitype='WM'
|
||||
else
|
||||
ui='unknown'
|
||||
uitype='UI'
|
||||
fi
|
||||
|
||||
## 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}${magenta}" # labels
|
||||
nc="${reset}${bold}${magenta}" # user and hostname
|
||||
ic="${reset}" # info
|
||||
c0="${reset}${bold}${magenta}" # first color
|
||||
c1="${reset}${magenta}" # second color
|
||||
|
||||
## OUTPUT
|
||||
|
||||
cat <<EOF
|
||||
|
||||
${c1} -,. ${nc}${USER}${ic}@${nc}${host}${reset}
|
||||
${c1} ''-., ${lc}OS: ${ic}${os}${reset}
|
||||
${c1} "'; ${lc}KERNEL: ${ic}${kernel}${reset}
|
||||
${c1} ; ${lc}UPTIME: ${ic}${uptime}${reset}
|
||||
${c1} ; ${lc}PACKAGES: ${ic}${packages}${reset}
|
||||
${c0} _.-" ${lc}SHELL: ${ic}${shell}${reset}
|
||||
${c0} _,--'' ${lc}${uitype}: ${ic}${ui}${reset}
|
||||
|
||||
EOF
|
||||
Reference in New Issue
Block a user