Skip to content

oabdrabo/DisplayDisabler

Repository files navigation

DisplayDisabler

Disable a MacBook's built-in display using private Apple CoreGraphics APIs. A 51 KB open-source alternative to BetterDisplay (30+ MB commercial app) for users who only need the disable-internal-display feature on headless / clamshell-mode MacBook setups.

Latest release License

Why

Closing a MacBook in clamshell mode and connecting an external display works, but the moment the lid opens the internal display reactivates. For headless / docked / external-monitor-only setups, you want the internal display permanently disabled until you explicitly re-enable it.

Existing tools:

Tool Size Notes
BetterDisplay 30+ MB Full-featured display management; overkill if you only need one feature
DisplayDisabler 51 KB Single-purpose, single-binary, no UI background process

Install

# Download the latest binary
curl -L -o DisplayDisabler https://github.com/oabdrabo/DisplayDisabler/releases/latest/download/DisplayDisabler
chmod +x DisplayDisabler
sudo mv DisplayDisabler /usr/local/bin/

Or build from source — see below.

Usage

# Disable the internal display
DisplayDisabler disable

# Re-enable
DisplayDisabler enable

# Toggle
DisplayDisabler toggle

How it works

Uses the private CGSConfigureDisplayEnabled Core Graphics function (part of SkyLight.framework) to flip the enabled state of the built-in display ID. The internal display retains its hardware identification but stops being part of the active display set.

Because this is a private API, the behaviour can change between macOS releases. Tested on macOS 13–14.

Build from source

git clone https://github.com/oabdrabo/DisplayDisabler.git
cd DisplayDisabler
make

Requires Xcode Command Line Tools (xcode-select --install).

License

MIT. See LICENSE.

About

Lightweight alternative to BetterDisplay - Disable MacBook built-in display using private CoreGraphics API. 51KB open-source tool vs 30MB app. Perfect for headless MacBook setups.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors