From c81e01405ebf0bdea72521bf5386db3a1c3de13c Mon Sep 17 00:00:00 2001 From: rage311 Date: Tue, 16 Jan 2018 12:36:29 -0700 Subject: [PATCH 1/6] Changed OpenBSD CPU temp retrieval to take into account machines that only expose cpu0.temp0 instead of lm0.temp0 --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 66daa1a0..10016076 100755 --- a/neofetch +++ b/neofetch @@ -1086,8 +1086,9 @@ get_cpu() { deg="${deg/C}" ;; "OpenBSD"* | "Bitrig"*) - deg="$(sysctl -n hw.sensors.lm0.temp0)" - deg="${deg/ degC}" + deg_var="$(sysctl hw.sensors | grep -m1 temp0 | cut -d'=' -f1)" + deg="$(sysctl -n $deg_var)" + deg="${deg/0 degC}" ;; esac ;; From 96676ca4d5c8bf54aea579511366cf36630fe910 Mon Sep 17 00:00:00 2001 From: rage311 Date: Tue, 16 Jan 2018 12:46:25 -0700 Subject: [PATCH 2/6] Fixed OpenBSD mem_used value --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 10016076..fdff930b 100755 --- a/neofetch +++ b/neofetch @@ -1466,9 +1466,10 @@ get_memory() { # Mem used. case "$kernel_name" in "OpenBSD"*) - mem_used="$(vmstat | awk 'END{printf $4}')" - mem_used="$((${mem_used/M} / 1024))" + mem_used="$(vmstat | awk 'END{printf $3}')" + mem_used="${mem_used/M}" ;; + *) mem_used="$((mem_total - mem_free))" ;; esac ;; From 9984c51882dc3f7b1d2028ad427f84e7cb257c56 Mon Sep 17 00:00:00 2001 From: rage311 Date: Tue, 16 Jan 2018 12:48:33 -0700 Subject: [PATCH 3/6] Fixed indentation inconsistency --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index fdff930b..32b5640a 100755 --- a/neofetch +++ b/neofetch @@ -3788,7 +3788,7 @@ get_distro_colors() { ascii_file="scientific" ;; - "Siduction"*) + "Siduction"*) set_colors 4 4 ascii_file="siduction" ;; From 840a6534582f7b4248e3bd702dc1d699246be27f Mon Sep 17 00:00:00 2001 From: rage311 Date: Tue, 16 Jan 2018 13:33:58 -0700 Subject: [PATCH 4/6] Changed OpenBSD cpu temp logic to grep specifically for lm0 or cpu0 --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 32b5640a..c57e7754 100755 --- a/neofetch +++ b/neofetch @@ -1086,7 +1086,7 @@ get_cpu() { deg="${deg/C}" ;; "OpenBSD"* | "Bitrig"*) - deg_var="$(sysctl hw.sensors | grep -m1 temp0 | cut -d'=' -f1)" + deg_var="$(sysctl hw.sensors | grep -m1 -E 'lm0.temp0|cpu0.temp0' | cut -d'=' -f1)" deg="$(sysctl -n $deg_var)" deg="${deg/0 degC}" ;; From c9f910f526824c9e7019b1818d22f9dd132865a3 Mon Sep 17 00:00:00 2001 From: rage311 Date: Wed, 17 Jan 2018 12:52:24 -0700 Subject: [PATCH 5/6] Changed OpenBSD temperature extraction from grep/cut to awk --- neofetch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index c57e7754..ccab3ccd 100755 --- a/neofetch +++ b/neofetch @@ -1086,9 +1086,8 @@ get_cpu() { deg="${deg/C}" ;; "OpenBSD"* | "Bitrig"*) - deg_var="$(sysctl hw.sensors | grep -m1 -E 'lm0.temp0|cpu0.temp0' | cut -d'=' -f1)" - deg="$(sysctl -n $deg_var)" - deg="${deg/0 degC}" + deg="$(sysctl hw.sensors | awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')" + deg="${deg/00/0}" ;; esac ;; From 64c80b7fc1168dde59a77a6dca05c859b0a1c0c0 Mon Sep 17 00:00:00 2001 From: rage311 Date: Mon, 22 Jan 2018 12:13:16 -0700 Subject: [PATCH 6/6] Broke up line that was over 100 chars long --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ccab3ccd..8df42edc 100755 --- a/neofetch +++ b/neofetch @@ -1086,7 +1086,8 @@ get_cpu() { deg="${deg/C}" ;; "OpenBSD"* | "Bitrig"*) - deg="$(sysctl hw.sensors | awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')" + deg="$(sysctl hw.sensors | \ + awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')" deg="${deg/00/0}" ;; esac