4

I frequently prefer to boot into the command line mode (CMD + S on boot) instead of booting to the normal GUI-imposed version. I do most of my work in the terminal, so it's nice to save some time and bypass all the unnecessary UI.

However, on retina machines, the command line mode displays at a 1:1 ratio (instead of a 2:1), meaning all text is very, very small. I really want to reduce the resolution it displays at by a factor of two. Is this possible, and if so, how?

2
+25

I found this for you

scrutil

Slightly more advanced due to the nature of the command line, the free utility called screenutil gets the job done immediately with a quick entry into the Terminal.

Launch Terminal and drag and drop scrutil into the command line to use it once, but if plan on using it often it’s a good idea to toss scrutil into /usr/local/bin for easy future access. Once installed, changing the retina display to native 2880×1800 with screenutil is achieved with the following command example:

scrutil s 2880 1800 16

The command will report back the resolution change, the 16 at the end is color depth so you can set that to something else if you’d like. You can set it back to the default resolution either through System Preferences or with scrutil s 1440 900.

There is also this:

http://hints.macworld.com/article.php?story=20090413120929454

/*
 * COMPILE:
 *    c++ setgetscreenres.m -framework ApplicationServices -o setgetscreenres
 * USE:
 *    setgetscreenres 1440 900
 */

#include <ApplicationServices/ApplicationServices.h>

bool MyDisplaySwitchToMode (CGDirectDisplayID display, CFDictionaryRef mode);

int main (int argc, const char * argv[])
{
    int h;                          // horizontal resolution
    int v;                          // vertical resolution
    CFDictionaryRef switchMode;     // mode to switch to
    CGDirectDisplayID mainDisplay;  // ID of main display

    CFDictionaryRef CGDisplayCurrentMode(CGDirectDisplayID display);

    if (argc == 1) {
        CGRect screenFrame = CGDisplayBounds(kCGDirectMainDisplay);
        CGSize screenSize  = screenFrame.size;
        printf("%d %d\n", screenSize.width, screenSize.height);
        return 0;
    }
    if (argc != 3 || !(h = atoi(argv[1])) || !(v = atoi(argv[2])) ) {
        fprintf(stderr, "ERROR: Use %s horres vertres\n", argv[0]);
        return -1;
    }

    mainDisplay = CGMainDisplayID();

    switchMode = CGDisplayBestModeForParameters(mainDisplay, 32, h, v, NULL);

    if (! MyDisplaySwitchToMode(mainDisplay, switchMode)) {
        fprintf(stderr, "Error changing resolution to %d %d\n", h, v);
        return 1;
    }

    return 0;
}

bool MyDisplaySwitchToMode (CGDirectDisplayID display, CFDictionaryRef mode)
{
    CGDisplayConfigRef config;
    if (CGBeginDisplayConfiguration(&config) == kCGErrorSuccess) {
        CGConfigureDisplayMode(config, display, mode);
        CGCompleteDisplayConfiguration(config, kCGConfigureForSession );
        return true;
    }
    return false;
}

Save that as a pure text file named setgetscreenres.m, then compile it in Terminal using the command shown in the code (assuming you're in the directory where the file is saved):

c++ setgetscreenres.m -framework ApplicationServices -o setgetscreenres

Move this file somewhere on your user's $PATH, and then use it by typing ./setgetscreenres hor_res vert_res, where hor_res and vert_res are the desire horizontal and vertical resolution.

Disclaimer: I have not tested it!

  • 1
    That definitely looks promising. Unfortunately it seems the site that scrutil was hosted at is now down, and I can't find a place to get it. – Josiah Dec 8 '14 at 19:25
  • 1
    sorry for that, I did not check it my self since I do not have your set up.-- a GUI user :) – Ruskes Dec 8 '14 at 19:38
  • 2
    Ok I uploaded it here: github.com/ponychicken/screenutil – Leo Dec 10 '14 at 10:13
  • 1
    Thanks for the find! However, after trying the utility I found that it doesn't work in single user mode. Trying to use it simply gives me an "invalid display" message. – Josiah Dec 12 '14 at 3:31
  • 1
    @DanPritts refer to the answer I posted regarding displayplacer. It works on Mojave. – Jake Hilborn Apr 9 at 22:02
0

Years ago, I used cscreen to map a Keyboard Maestro shortcut to a shell script. It might work for your purposes.

http://www.pyehouse.com/cscreen/

The dev updated it for Intel machines a couple of years ago but did not have a retina machine for testing.

I expect we will all have to deal with this problem eventually.

0

I wrote a command line application that supports multi-display resolutions, rotations, mirroring, and positioning called displayplacer. In addition to GitHub releases, you can also install via Homebrew: brew tap jakehilborn/jakehilborn && brew install displayplacer

0

Assuming you have a WindowServer (as the scrutil, setgetscreenres and displayplacer answers assume, and true under Mojave even with ⌘-S), you can also try the displaymode command-line utility to change the resolution. Grab it from:

https://github.com/p00ya/displaymode

To change the resolution to 1280x800, run it like:

./displaymode t 1280 800

This is a simple replacement for scrutil that doesn't use any deprecated or private Apple APIs, and is built for modern architectures.

0

To actually answer the original question regarding single-user (text) mode: the resolution of the text console is typically a kernel parameter (e.g. on linux it's the vga= parameter).

I don't have a pre-Mojave system to test on, but see this description of boot-args, which implies you may be able to get VGA-res with:

sudo nvram boot-args="Text Mode"

or set the resolution explicitly:

sudo nvram boot-args='"Graphics Mode"="1024x768x32"'

You'll need to run nvram with system integrity protection disabled (reboot into recovery mode with ⌘-R and run csrutil disable first).

Note that these days (Mojave) ⌘-S on boot does not leave you in a text mode - you will end up with a WindowServer and can use CoreGraphics-based utilities like scrutil and displayplacer to change the resolution, even though the text mode displays temporarily during boot. But then since you'd be using Terminal.app anyway, you can just change the font size ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .