From 2a599a2fa0861c9756eaf08c9eec77b79a9c18ea Mon Sep 17 00:00:00 2001 From: GaugeK Date: Sat, 15 Aug 2020 01:16:31 +1000 Subject: [PATCH] a few visual changes --- fet.sh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/fet.sh b/fet.sh index b658943..24cd467 100755 --- a/fet.sh +++ b/fet.sh @@ -54,7 +54,6 @@ mem="${mem%% *}" mem="$(( mem / 1000 ))" ## Processor -# can't really test on AMD. Please make an issue if it doesn't work while read -r line; do case $line in vendor_id*) vendor="${line##*: }";; @@ -63,6 +62,7 @@ while read -r line; do done < /proc/cpuinfo vendor="${vendor##*Authentic}" vendor="${vendor##*Genuine}" +# This is so messy due to so many inconsistencies in the model names cpu="${cpu##*) }" cpu="${cpu%% @*}" cpu="${cpu%% CPU}" @@ -85,7 +85,6 @@ case $version in esac ## GTK -# why not..? while read -r line; do case $line in gtk-theme*) gtk="${line##*=}"; break;; @@ -102,17 +101,23 @@ read -r model < /sys/devices/virtual/dmi/id/product_name [ $# -gt 0 ] && pkgs=$# print() { - printf '\033[34m%6s\033[0m | %s\n' "$1" "$2" + [ "$2" ] && printf '\033[34m%6s\033[0m ~ %s\n' "$1" "$2" } -[ "$ID" ] && print os "$ID" -[ "$SHELL" ] && print sh "${SHELL##*/}" -[ "$wm" ] && print wm "$wm" -[ "$d" ] && print up "${d}d $up" -[ "$gtk" ] && print gtk "${gtk# }" -[ "$cpu" ] && print cpu "$vendor $cpu" -[ "$mem" ] && print mem "${mem}MB" -[ "$model" ] && print host "$model" -[ "$kernel" ] && print kern "$kernel" -[ "$term" ] && print term "$term" -[ "$pkgs" ] && print "pkgs" "$pkgs" + +echo +read -r host < /etc/hostname +printf '%7s@%s\n' "$USER" "$host" + +print os "$ID" +print sh "${SHELL##*/}" +print wm "$wm" +print up "${d}d $up" +print gtk "${gtk# }" +print cpu "$vendor $cpu" +print mem "${mem}MB" +print host "$model" +print kern "$kernel" +print pkgs "$pkgs" +print term "$term" +echo