misc: cleanup

This commit is contained in:
Dylan Araps 2018-06-04 06:51:30 +10:00
parent c461704b36
commit 23d02ae90e

View file

@ -1430,11 +1430,15 @@ get_de() {
# Format strings. # Format strings.
case "$de" in case "$de" in
"KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;;
*"MUFFIN"* | "Cinnamon") de="$(cinnamon --version)"; de="${de:-Cinnamon}" ;;
*"xfce4"*) de="Xfce4" ;; *"xfce4"*) de="Xfce4" ;;
*"xfce5"*) de="Xfce5" ;; *"xfce5"*) de="Xfce5" ;;
*"xfce"*) de="Xfce" ;; *"xfce"*) de="Xfce" ;;
*"mate"*) de="MATE" ;; *"mate"*) de="MATE" ;;
*"MUFFIN"* | "Cinnamon")
de="$(cinnamon --version)"; de="${de:-Cinnamon}"
;;
*"GNOME"*) *"GNOME"*)
de="$(gnome-shell --version)" de="$(gnome-shell --version)"
de="${de/Shell }" de="${de/Shell }"
@ -1524,15 +1528,14 @@ get_wm() {
;; ;;
"FreeMiNT") "FreeMiNT")
wm="Atari AES" freemint_wm=(/proc/*)
for files in /proc/*; do case "${freemint_wm[*]}" in
case "$files" in
*xaaes*) wm="XaAES" ;; *xaaes*) wm="XaAES" ;;
*myaes*) wm="MyAES" ;; *myaes*) wm="MyAES" ;;
*naes*) wm="N.AES" ;; *naes*) wm="N.AES" ;;
geneva) wm="Geneva" ;; geneva) wm="Geneva" ;;
*) wm="Atari AES" ;;
esac esac
done
;; ;;
esac esac
fi fi
@ -1876,7 +1879,9 @@ get_cpu() {
cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')"
;; ;;
"physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')" "physical")
cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')"
;;
esac esac
;; ;;
@ -1979,9 +1984,12 @@ get_cpu_usage() {
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;; "Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
"Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;; "Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;;
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;; "iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
"AIX") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;;
"IRIX") cores="$(sysconf NPROC_ONLN)" ;; "IRIX") cores="$(sysconf NPROC_ONLN)" ;;
"FreeMiNT") cores="$(sysctl -n hw.ncpu)" "FreeMiNT") cores="$(sysctl -n hw.ncpu)" ;;
"AIX")
cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')"
;;
esac esac
fi fi