Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrandr 1.4.2 and the "primary" flag #35

Closed
jnsnow opened this issue Feb 17, 2015 · 2 comments
Closed

xrandr 1.4.2 and the "primary" flag #35

jnsnow opened this issue Feb 17, 2015 · 2 comments

Comments

@jnsnow
Copy link

jnsnow commented Feb 17, 2015

autorandr does not appear to be able to handle xrandr 1.4.2's printing of the "primary" flag, because it always expects the mode and offset to be $3.

However, as seen in e.g. Fedora 20:
eDP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 175mm

primary might be $3, and mode/offset is $4, and $5 if present would be the rotation.

I wrote a quick hack for this:

diff --git a/autorandr b/autorandr
index c2c3384..5a61ca8 100755
--- a/autorandr
+++ b/autorandr
@@ -122,11 +122,17 @@ current_cfg_xrandr() {
        # display is connected and has a mode
        /^[^ ]+ connected [^(]/ {
                split($3, A, "+");
+               R = $4;
                print "output "$1;
+               if ($3 == "primary") {
+                       print "primary";
+                       split($4, A, "+");
+                       R = $5
+               }
                print "mode "A[1];
                print "pos "A[2]"x"A[3];
-               if ($4 !~ /^\(/) {
-                       print "rotate "$4;
+               if (R !~ /^\(/) {
+                       print "rotate "R;
                }
                if (A[1] A[2] "," A[3] == primary_setup)
                        print "primary";
@phillipberndt
Copy link

This repository is unmaintained. Please see #33. This has been fixed in phillipberndt/autorandr@3939171 by @tachylatus.

@jnsnow
Copy link
Author

jnsnow commented Feb 18, 2015

Whoops, missed the pullreq backstory. Thanks for maintaining the project, @phillipberndt

@jnsnow jnsnow closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants