Shun's org notes
31 Jul 2026

(macOS) Manage display resolution via CLI

There seem to be no official way to change display resolution from the cli on macOS, but p00ya/displaymode worked really well for me. I've fixed few stuffs & Nixified it, so feel free to try it out:

nix run github:shunueda/monorepo#displaymode

I put this in Home Manager's activation:

home = {
  activation = {
    # Darwin-specific activation script
    darwin = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin (
      lib.hm.dag.entryAfter [ "writeBoundary" ] ''
        # Set display resolution, mine is 14-inch.
        ${lib.getExe pkgs.displaymode} t 1800 1169
      ''
    );
  };
};

p00ya/displaymode is licensed under the Apache-2.0 license.

Tags: macOS nix
Other posts · Tags