From 920294ac15e6fb26e188336c821089cb2f1a5c4e Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Wed, 31 Dec 2014 13:21:30 +0100 Subject: [PATCH] Store refresh rate See https://github.com/wertarbyte/autorandr/issues/6 --- autorandr | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.39.2