From 4fbf8df1c80c49fdbef577e3723cc0d942c7eb31 Mon Sep 17 00:00:00 2001 From: Lorenzo Cauli Date: Fri, 11 Jun 2021 09:34:26 +0200 Subject: [PATCH 1/7] Edited PCLinuxOS logo for proper alignment. (#1685) Co-authored-by: Lorenzo Cauli --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 39f376fc..34ee2503 100755 --- a/neofetch +++ b/neofetch @@ -9314,7 +9314,7 @@ EOF "PCLinuxOS"*) set_colors 4 7 1 read -rd '' ascii_data <<'EOF' - ${c1}mhhhyyyyhhhdN +${c1} mhhhyyyyhhhdN dyssyhhhhhhhhhhhssyhN Nysyhhyo/:-.....-/oyhhhssd Nsshhy+. `/shhysm From 0bbd6bff86da9c1fd016a86fd1557666b31bf5fb Mon Sep 17 00:00:00 2001 From: freddii Date: Fri, 11 Jun 2021 09:37:20 +0200 Subject: [PATCH 3/7] fixes spelling mistake (#1654) --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 34ee2503..85473d29 100755 --- a/neofetch +++ b/neofetch @@ -158,7 +158,7 @@ uptime_shorthand="on" # Memory -# Show memory pecentage in output. +# Show memory percentage in output. # # Default: 'off' # Values: 'on', 'off' From 9b1108133caf38bcd8a19d4b96ebaa720caf0500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne?= Date: Fri, 11 Jun 2021 09:37:57 +0200 Subject: [PATCH 4/7] OpenBSD: change cpu count (#1650) Instead of using hw.ncpu, use hw.ncpuonline and hw.ncpufound, and check SMT status --- neofetch | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 85473d29..28900c8f 100755 --- a/neofetch +++ b/neofetch @@ -2286,7 +2286,17 @@ get_cpu() { [[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)" # Get CPU cores. - cores="$(sysctl -n hw.ncpu)" + case $kernel_name in + "OpenBSD"*) + [[ "$(sysctl -n hw.smt)" == "1" ]] && smt="on" || smt="off" + ncpufound="$(sysctl -n hw.ncpufound)" + ncpuonline="$(sysctl -n hw.ncpuonline)" + cores="${ncpuonline}/${ncpufound},\\xc2\\xa0SMT\\xc2\\xa0${smt}" + ;; + *) + cores="$(sysctl -n hw.ncpu)" + ;; + esac # Get CPU temp. case $kernel_name in From 219714c86ef298102ce7eb7bce1124ac9df9df68 Mon Sep 17 00:00:00 2001 From: Guanzhong Chen Date: Fri, 11 Jun 2021 03:39:07 -0400 Subject: [PATCH 5/7] Show GPU subsystem name if possible. Fixes #1490 (#1648) After this change, if a subsystem name exists for a GPU, we display that name instead of the device name. This should fix the issue mentioned in #1490. For example, a card that would be shown as: GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590 before will now be shown as: GPU: AMD ATI Radeon RX 480 4GB This fallback logic is implemented in the `awk` command. Additionally, the PCI address is now stripped from the awk output because it never is desirable to print it. It is, however, still kept internally in `awk` to distinguish multiple cards of the same model. --- neofetch | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 28900c8f..f93e1fea 100755 --- a/neofetch +++ b/neofetch @@ -2449,9 +2449,17 @@ get_gpu() { case $os in "Linux") # Read GPUs into array. - gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \ - '/"Display|"3D|"VGA/ {a[$0] = $1 " " $3 " " $4} - END {for(i in a) {if(!seen[a[i]]++) print a[i]}}')" + gpu_cmd="$(lspci -mm | + awk -F '\"|\" \"|\\(' \ + '/"Display|"3D|"VGA/ { + a[$0] = $1 " " $3 " " ($7 ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $7) + } + END { for (i in a) { + if (!seen[a[i]]++) { + sub("^[^ ]+ ", "", a[i]); + print a[i] + } + }}')" IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd" # Remove duplicate Intel Graphics outputs. From 07ae57453a5514e73a1c7c50b896b73f02532e9c Mon Sep 17 00:00:00 2001 From: kanashimia Date: Fri, 11 Jun 2021 10:41:32 +0300 Subject: [PATCH 6/7] Fix nix mistkae on darwin (#1628) See https://github.com/dylanaraps/neofetch/pull/1617#issuecomment-740655977 --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index f93e1fea..e681598f 100755 --- a/neofetch +++ b/neofetch @@ -1644,7 +1644,7 @@ get_packages() { nix-store -qR /etc/profiles/per-user/"$USER" } manager=nix-system && tot nix-store -qR /run/current-system/sw - manager=nix-user && tot nix-store -qR nix-user-pkgs + manager=nix-user && tot nix-user-pkgs } ;; From 70ad34e919b301f007fd18e5daf81120b45ce6db Mon Sep 17 00:00:00 2001 From: Koakuma Date: Fri, 11 Jun 2021 14:42:46 +0700 Subject: [PATCH 7/7] Fix CPU core/frequency reading on Linux/SPARC systems (#1643) --- neofetch | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index e681598f..2f0bb9e6 100755 --- a/neofetch +++ b/neofetch @@ -2213,17 +2213,50 @@ get_cpu() { speed="$((speed / 1000))" else - speed="$(awk -F ': |\\.' '/cpu MHz|^clock/ {printf $2; exit}' "$cpu_file")" - speed="${speed/MHz}" + case $kernel_machine in + "sparc"*) + # SPARC systems use a different file to expose clock speed information. + speed_file="/sys/devices/system/cpu/cpu0/clock_tick" + speed="$(($(< "$speed_file") / 1000000))" + ;; + + *) + speed="$(awk -F ': |\\.' '/cpu MHz|^clock/ {printf $2; exit}' "$cpu_file")" + speed="${speed/MHz}" + ;; + esac fi # Get CPU temp. [[ -f "$temp_dir" ]] && deg="$(($(< "$temp_dir") * 100 / 10000))" # Get CPU cores. - case $cpu_cores in - "logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;; - "physical") cores="$(awk '/^core id/&&!a[$0]++{++i} END {print i}' "$cpu_file")" ;; + case $kernel_machine in + "sparc"*) + case $cpu_cores in + # SPARC systems doesn't expose detailed topology information in + # /proc/cpuinfo so I have to use lscpu here. + "logical" | "on") + cores="$(lscpu | awk -F ': *' '/^CPU\(s\)/ {print $2}')" + ;; + "physical") + cores="$(lscpu | awk -F ': *' '/^Core\(s\) per socket/ {print $2}')" + sockets="$(lscpu | awk -F ': *' '/^Socket\(s\)/ {print $2}')" + cores="$((sockets * cores))" + ;; + esac + ;; + + *) + case $cpu_cores in + "logical" | "on") + cores="$(grep -c "^processor" "$cpu_file")" + ;; + "physical") + cores="$(awk '/^core id/&&!a[$0]++{++i} END {print i}' "$cpu_file")" + ;; + esac + ;; esac ;;