From cd51987f178ee62ace468487ea24d58311f84bea Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Wed, 15 Jun 2016 20:18:57 +1000 Subject: [PATCH 1/2] improved refresh_rate fix, now actually works on OS X... --- neofetch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 035e960e..75260b86 100755 --- a/neofetch +++ b/neofetch @@ -1538,8 +1538,15 @@ getresolution () { awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" fi - [ "$refresh_rate" == "off" ] || [ "${resolution// * @ }" == "0Hz" ] && \ - resolution="${resolution// @ *[0-9]Hz}" + if [ "$refresh_rate" == "off" ] || [ "${resolution// * @ }" == "0Hz" ]; then + IFS="," + for res in $resolution; do + res="${res// @ *[0-9]Hz}" + newres="$newres, $res" + done + unset IFS + resolution="${newres:2}" + fi ;; "Windows") From df1e73a6b054dcd3aec712a55441662810a4b6bc Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Wed, 15 Jun 2016 21:02:33 +1000 Subject: [PATCH 2/2] better way that works in multi monitor setups --- neofetch | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/neofetch b/neofetch index 75260b86..7fb146af 100755 --- a/neofetch +++ b/neofetch @@ -1538,15 +1538,13 @@ getresolution () { awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" fi - if [ "$refresh_rate" == "off" ] || [ "${resolution// * @ }" == "0Hz" ]; then - IFS="," - for res in $resolution; do - res="${res// @ *[0-9]Hz}" - newres="$newres, $res" - done - unset IFS - resolution="${newres:2}" + if [ "$refresh_rate" == "off" ]; then + resolution="${resolution// @ [0-9][0-9]Hz}" + resolution="${resolution// @ [0-9][0-9][0-9]Hz}" fi + + [[ "$resolution" =~ "0Hz" ]] && \ + resolution="${resolution// @ 0Hz}" ;; "Windows")