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

Add displays management #40

Open
Anahkiasen opened this issue Jul 16, 2016 · 3 comments
Open

Add displays management #40

Anahkiasen opened this issue Jul 16, 2016 · 3 comments

Comments

@Anahkiasen
Copy link

I have two screens and I constantly switch the main one because I also use one of the two for the PC. Would love to have a command like m displays switch or something that switches screen, like when dragging the bar here from one screen to another:

screen shot 2016-07-16 at 20 51 40

@rgcr
Copy link
Owner

rgcr commented Jul 16, 2016

That's a great idea 👍

@pbnj
Copy link
Contributor

pbnj commented Dec 4, 2016

This can potentially be accomplished by doing a defaults write to modify the appropriate attribute(s) in com.apple.windowserver.plist.

I just don't have a secondary monitor to test/compare the settings when one monitor is the primary vs when the other monitor is the primary.

For instance, here is my output from reading the Displays Preferences (currently using the built-in macbook display only):

$ defaults read /Library/Preferences/com.apple.windowserver.plist
{
    DisplayResolutionEnabled = 1;
    DisplaySets =     (
                (
                        {
                Active = 1;
                Depth = 4;
                DisplayID = 69731456;
                DisplayProductID = 40978;
                DisplaySerialNumber = 0;
                DisplayVendorID = 1552;
                Height = 1080;
                IODisplayLocation = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/P0P2@1/IOPCI2PCIBridge/GFX0@0/NVDA,Display-A@0/NVDA";
                IOFlags = 7;
                LimitsHeight = 1080;
                LimitsOriginX = 0;
                LimitsOriginY = 0;
                LimitsWidth = 1920;
                MirrorID = 0;
                Mirrored = 0;
                Mode =                 {
                    BitsPerPixel = 32;
                    BitsPerSample = 8;
                    DepthFormat = 4;
                    Height = 1080;
                    IODisplayModeID = "-2147479552";
                    IOFlags = 7;
                    Mode = 1;
                    PixelEncoding = "--------RRRRRRRRGGGGGGGGBBBBBBBB";
                    RefreshRate = 0;
                    SamplesPerPixel = 3;
                    UsableForDesktopGUI = 1;
                    Width = 1920;
                    kCGDisplayBytesPerRow = 7680;
                    kCGDisplayHorizontalResolution = 103;
                    kCGDisplayModeIsInterlaced = 0;
                    kCGDisplayModeIsSafeForHardware = 1;
                    kCGDisplayModeIsStretched = 0;
                    kCGDisplayModeIsTelevisionOutput = 0;
                    kCGDisplayModeIsUnavailable = 0;
                    kCGDisplayModeSuitableForUI = 1;
                    kCGDisplayPixelsHigh = 1080;
                    kCGDisplayPixelsWide = 1920;
                    kCGDisplayResolution = 1;
                    kCGDisplayVerticalResolution = 103;
                };
                OriginX = 0;
                OriginY = 0;
                PixelEncoding = "--------RRRRRRRRGGGGGGGGBBBBBBBB";
                Resolution = 1;
                Unit = 0;
                UnmirroredHeight = 1080;
                UnmirroredLimitsHeight = 1080;
                UnmirroredLimitsOriginX = 0;
                UnmirroredLimitsOriginY = 0;
                UnmirroredLimitsWidth = 1920;
                UnmirroredMode =                 {
                    BitsPerPixel = 32;
                    BitsPerSample = 8;
                    DepthFormat = 4;
                    Height = 1080;
                    IODisplayModeID = "-2147479552";
                    IOFlags = 7;
                    Mode = 1;
                    PixelEncoding = "--------RRRRRRRRGGGGGGGGBBBBBBBB";
                    RefreshRate = 0;
                    SamplesPerPixel = 3;
                    UsableForDesktopGUI = 1;
                    Width = 1920;
                    kCGDisplayBytesPerRow = 7680;
                    kCGDisplayHorizontalResolution = 103;
                    kCGDisplayModeIsInterlaced = 0;
                    kCGDisplayModeIsSafeForHardware = 1;
                    kCGDisplayModeIsStretched = 0;
                    kCGDisplayModeIsTelevisionOutput = 0;
                    kCGDisplayModeIsUnavailable = 0;
                    kCGDisplayModeSuitableForUI = 1;
                    kCGDisplayPixelsHigh = 1080;
                    kCGDisplayPixelsWide = 1920;
                    kCGDisplayResolution = 1;
                    kCGDisplayVerticalResolution = 103;
                };
                UnmirroredOriginX = 0;
                UnmirroredOriginY = 0;
                UnmirroredResolution = 1;
                UnmirroredWidth = 1920;
                Width = 1920;
            }
        )
    );
    ForceOldStyleMemoryManagement = 0;
}

@rgcr
Copy link
Owner

rgcr commented Dec 5, 2016

@pmbenjamin, I'll test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants