Fix xrandr output on systems not using gawk

This commit is contained in:
Dylan Araps 2016-06-24 11:44:22 +10:00
parent 09e3dc5146
commit c8439c4bf9
1 changed files with 2 additions and 2 deletions

View File

@ -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//\*}"