mirror of
https://github.com/eepykate/fet.sh.git
synced 2026-12-04 21:48:23 +00:00
fix more AMD cpus, supress errors
This commit is contained in:
1 parent
94f6c72e50
commit
6a40df9d75
1 file changed
+14
-8
@@ -4,6 +4,9 @@
|
|||||||
# without any external commands
|
# without any external commands
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# supress errors
|
||||||
|
exec 2>/dev/null
|
||||||
|
|
||||||
## Terminal
|
## Terminal
|
||||||
ppid() {
|
ppid() {
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
@@ -21,7 +24,9 @@ while [ ! "$term" ]; do
|
|||||||
*[Ll]ogin*|*init*) term=linux;;
|
*[Ll]ogin*|*init*) term=linux;;
|
||||||
*) term="$name";;
|
*) term="$name";;
|
||||||
esac
|
esac
|
||||||
|
o="$ppid"
|
||||||
ppid=$(ppid "$ppid")
|
ppid=$(ppid "$ppid")
|
||||||
|
[ "$o" = "$ppid" ] && break
|
||||||
done
|
done
|
||||||
|
|
||||||
## WM/DE
|
## WM/DE
|
||||||
@@ -85,6 +90,7 @@ cpu="${cpu%% CPU}"
|
|||||||
cpu="${cpu##CPU }"
|
cpu="${cpu##CPU }"
|
||||||
cpu="${cpu##*AMD }"
|
cpu="${cpu##*AMD }"
|
||||||
cpu="${cpu%% with*}"
|
cpu="${cpu%% with*}"
|
||||||
|
cpu="${cpu% *-Core*}"
|
||||||
|
|
||||||
## Uptime
|
## Uptime
|
||||||
# the simple math is shamefully stolen from aosync
|
# the simple math is shamefully stolen from aosync
|
||||||
@@ -136,14 +142,14 @@ print() {
|
|||||||
printf '\033[34m%6s\033[0m | %s\n' "$1" "$2"
|
printf '\033[34m%6s\033[0m | %s\n' "$1" "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
print os "$ID"
|
[ "$ID" ] && print os "$ID"
|
||||||
print sh "${SHELL##*/}"
|
[ "$SHELL" ] && print sh "${SHELL##*/}"
|
||||||
[ "$wm" ] && print wm "$wm"
|
[ "$wm" ] && print wm "$wm"
|
||||||
print up "${d}d ${h}:${m}"
|
[ "$m" ] && print up "${d}d ${h}:${m}"
|
||||||
[ "$gtk" ] && print gtk "$gtk"
|
[ "$gtk" ] && print gtk "$gtk"
|
||||||
print cpu "$vendor $cpu"
|
[ "$cpu" ] && print cpu "$vendor $cpu"
|
||||||
print mem "${mem}MB"
|
[ "$mem" ] && print mem "${mem}MB"
|
||||||
print host "$model"
|
[ "$model" ] && print host "$model"
|
||||||
print kern "$kernel"
|
[ "$kernel" ] && print kern "$kernel"
|
||||||
print term "$term"
|
[ "$term" ] && print term "$term"
|
||||||
[ "$pkgs" ] && print "pkgs" "$pkgs"
|
[ "$pkgs" ] && print "pkgs" "$pkgs"
|
||||||
Reference in new issue
Block a user