]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Enable outputs in pairs of two (Follow-up to commit f4cce4d)
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sat, 13 Dec 2014 14:59:41 +0000 (15:59 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Sat, 13 Dec 2014 14:59:41 +0000 (15:59 +0100)
autorandr

index 5937f8a2a8ad3ded1cd9dd27a3d9d7b3535b1bcf..fa575b196346552dd44c10666468ce428caef9b8 100755 (executable)
--- a/autorandr
+++ b/autorandr
@@ -282,6 +282,7 @@ load_cfg_xrandr() {
        #         * Remaining outputs are appended as they appear
        #         * Keep everything in hold buffer until the last line
        # sed 4: Remove empty lines caused by G and H on empty hold buffer
+       # sed 5: Join lines enabling screens in pairs of two (See https://github.com/phillipberndt/autorandr/pull/6)
        sed 's/^/--/' "$1" | sed -e '
                :START
                /\n--output/{P;D}
@@ -304,7 +305,9 @@ load_cfg_xrandr() {
                        H
                        $!d
                        x' | sed -e '
-                               /./ !d' | xargs -L 1 $XRANDR
+                               /./ !d' | sed -e '
+                                       /--mode/{ N; s/\n/ /; }
+                               ' | xargs -L 1 $XRANDR
 }
 
 load_cfg_disper() {