From 0d64fac031a41b5c80389773c3740ab4ef9585ca Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 26 Mar 2016 08:51:39 +1100 Subject: [PATCH] added xrandr without refresh rate --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index cbb22b62..6f58618d 100755 --- a/neofetch +++ b/neofetch @@ -1273,8 +1273,11 @@ getsong () { getresolution () { case "$os" in "Linux" | *"BSD") - if type -p xrandr >/dev/null 2>&1 && [ "$refresh_rate" == "on" ]; then - resolution=$(xrandr --nograb --current | awk 'match($0,/[0-0]{2,3}.[0-9]{2}\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}') + if type -p xrandr >/dev/null 2>&1; then + case "$refresh_rate" in + "on") resolution=$(xrandr --nograb --current | awk 'match($0,/[0-0]{2,3}.[0-9]{2}\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}') ;; + "off") resolution=$(xrandr --nograb --current | awk '/*/ {printf $1 ", "}') ;; + esac resolution=${resolution//\*} elif type -p xdpyinfo >/dev/null 2>&1 && \