From: Phillip Berndt Date: Wed, 31 Dec 2014 12:21:30 +0000 (+0100) Subject: Store refresh rate X-Git-Tag: 1.0~102^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=920294ac15e6fb26e188336c821089cb2f1a5c4e;p=deb_pkgs%2Fautorandr.git Store refresh rate See https://github.com/wertarbyte/autorandr/issues/6 --- diff --git a/autorandr b/autorandr index fa575b1..30094e7 100755 --- a/autorandr +++ b/autorandr @@ -126,6 +126,7 @@ current_cfg_xrandr() { $XRANDR -q | awk -v primary_setup="${PRIMARY_SETUP}" ' # display is connected and has a mode /^[^ ]+ connected [^(]/ { + output=$1 print "output "$1; if ($3 == "primary") { print $3 @@ -151,9 +152,19 @@ current_cfg_xrandr() { } next; } + / [0-9]+x[0-9]+ .+/ { + if (output) { + for (n=1; n<10; n++) { + if($n ~ /[0-9]+\.[0-9]+\*/) { + print "rate " gensub(/(+|\*)/, "", "g", $n); + } + } + } + } # disconnected or disabled displays /^[^ ]+ (dis)?connected / || /^[^ ]+ unknown connection / { + output="" print "output "$1; print "off"; next;