From c8439c4bf9dbc359ff6c600e6bd0c51188cae67e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 24 Jun 2016 11:44:22 +1000 Subject: [PATCH] Fix xrandr output on systems not using gawk --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index c4c42036..9f88159a 100755 --- a/neofetch +++ b/neofetch @@ -1518,8 +1518,8 @@ getresolution () { "Linux" | "BSD") if type -p xrandr >/dev/null 2>&1; then case "$refresh_rate" in - "on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]{2,3}.[0-9]{2}\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;; - "off") resolution="$(xrandr --nograb --current | awk '/*/ {printf $1 ", "}')" ;; + "on") resolution="$(xrandr --nograb --current | nawk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;; + "off") resolution="$(xrandr --nograb --current | awk '/\*/ {printf $1 ", "}')" ;; esac resolution="${resolution//\*}"