]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Store refresh rate
authorPhillip Berndt <phillip.berndt@googlemail.com>
Wed, 31 Dec 2014 12:21:30 +0000 (13:21 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Wed, 31 Dec 2014 12:21:30 +0000 (13:21 +0100)
See https://github.com/wertarbyte/autorandr/issues/6

autorandr

index fa575b196346552dd44c10666468ce428caef9b8..30094e79d333875272d2d291bf6af5ae62737ad6 100755 (executable)
--- 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;