]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Set virtual 'common' config via load_cfg_xrandr by piping into the sed.
authorTimo Bingmann <tbgit@panthema.net>
Sun, 20 Jul 2014 10:05:46 +0000 (12:05 +0200)
committerTimo Bingmann <tbgit@panthema.net>
Sun, 20 Jul 2014 10:05:46 +0000 (12:05 +0200)
autorandr

index 1f82fb273698ee409c480db5a3dbc299854bf652..e2afd428019c274c2e90f32cca0a47681fc70d10 100755 (executable)
--- a/autorandr
+++ b/autorandr
@@ -167,9 +167,6 @@ common_cfg_xrandr() {
        #   outputarr: array of all connected outputs
        #   outputarrsize: number of connected outputs
        #   modelist[800x600]: space sep list of outputs supporting mode
-       BEGIN {
-           ORS = " " # output space sep argument list for xrandr
-       }
        # display is connected
        /^[^ ]+ connected / {
            output=$1;
@@ -179,7 +176,8 @@ common_cfg_xrandr() {
        # disconnected or disabled displays
        /^[^ ]+ disconnected / ||
        /^[^ ]+ unknown connection / {
-           print "--output",$1,"--off";
+           print "output " $1;
+           print "off";
        }
        # modes available on a screen
        /^   [0-9]+x[0-9]+/ {
@@ -198,12 +196,14 @@ common_cfg_xrandr() {
                }
            }
            if (maxmode) {
-               for (i in outputarr)
-                   print "--output",outputarr[i],"--mode",maxmode,"--pos","0x0"
+               for (i in outputarr) {
+                   print "output " outputarr[i];
+                   print "mode " maxmode;
+                   print "pos 0x0";
+               }
            }
-           print param
        }' \
-               | xargs -L 1 $XRANDR
+               | load_cfg_xrandr -
 }
 
 current_cfg() {