• Stars
    star
    593
  • Rank 75,443 (Top 2 %)
  • Language
    C
  • License
    BSD 2-Clause "Sim...
  • Created almost 11 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line display brightness control for macOS.

brightness

Command-line display brightness control for macOS.

This tool enables you to set and obtain the brightness level of all internal and certain external displays from the command line or a script.

If you cannot control your display’s brightness from Displays System Preferences, you will not be able to do it with brightness. See this issue for more information and some potential other options.

Install with Homebrew

brew install brightness

Install From Source

git clone https://github.com/nriley/brightness.git
cd brightness
make
sudo make install

macOS Version Support

brightness requires OS X/macOS 10.8 or later — but go back in the commit history and you’ll find code compatible with older (Mac) OS X versions.

Through macOS 10.12.3, brightness uses documented APIs. It works on internal laptop displays. It doesn’t work on older Apple external LCDs which connect via DVI and USB. I don’t know if it works on newer external displays, such as Thunderbolt displays, because I don’t have any to test with. (Feedback welcome.)

As of macOS 10.12.4 with the introduction of Night Shift, the documented APIs fail to work correctly and Apple does not provide replacement APIs. Therefore, brightness uses an undocumented method to adjust brightness.

macOS 11 on M1/Apple Silicon Macs require yet another undocumented method to adjust brightness (thanks to @jtbandes).

Usage Examples

Set 100% brightness: brightness 1

Set 50% brightness: brightness 0.5

Show current brightness: brightness -l

% brightness
usage: brightness [-m|-d display] [-v] <brightness>
   or: brightness -l [-v]
% brightness -lv
display 0: main, active, awake, online, external, ID 0x1b56353c
	resolution 2560 x 1440 pt (5120 x 2880 px), origin (0, 0)
	physical size 599 x 340 mm
	IOKit flags 0x7; IOKit display mode ID 0x80005000
	usable for desktop GUI, uses OpenGL acceleration
display 0: brightness 0.500000
display 1: active, awake, online, external, ID 0x3f003f
	resolution 1112 x 834 pt (2224 x 1668 px) @ 60.0 Hz, origin (732, 1440)
	physical size 392 x 294 mm
	IOKit flags 0x7; IOKit display mode ID 0x4
	usable for desktop GUI, uses OpenGL acceleration
brightness: unable to get brightness of display 0x3f003f
% brightness -m 0.6
% brightness -l    
display 0: main, active, awake, online, external, ID 0x1b56353c
display 0: brightness 0.600000
[...]

More Repositories

1

Pester

Simple, disposable alarms and timers for macOS.
Perl
158
star
2

launch

A command-line launcher for macOS in the spirit of open(1).
Objective-C
64
star
3

appswitch

Switch, hide, show, quit, kill or list macOS applications from the command line or scripts.
Objective-C
63
star
4

SoundSource

Rogue Amoeba’s SoundSource 2.5, with added command line tool for switching audio devices and setting volume.
Objective-C
53
star
5

Karabiner-Elements-App-Profiles

Workaround for lack of app-specific behavior in Karabiner-Elements
Swift
46
star
6

Shroud

An overlay window that doesn’t activate when you click on it. Also (optionally) obscures your menu bar until you mouse over it.
Objective-C
36
star
7

OmniFocus-Plug-Ins

OmniFocus plug-ins I've written
JavaScript
21
star
8

jython

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in Java.
Java
17
star
9

LBOfficeMRU

LaunchBar actions which let you access recent documents in Mac Office 365/2016/2019 applications
Python
15
star
10

keyboardViewer

Show the Keyboard Viewer on Mac OS X 10.6.
Objective-C
13
star
11

Sparkle

32-bit compatible Sparkle backport for Pester (no longer maintained). Note that this repository is unrelated to the current Sparkle Project repository.
C
7
star
12

OpenInNewTab

Safari extension that installs an event handler allowing NewsBlur to open links in a new tab.
JavaScript
7
star
13

NewsBlur-Helper

Improve integration between NewsBlur, macOS 10.12.6+ and Safari 11+.
Objective-C
6
star
14

LBHue

A LaunchBar action for controlling Philips hue lights.
Python
5
star
15

DragonControl

Rough scripts for using Dragon Medical in Windows 7 under VMware Fusion as a dictation buffer for macOS.
Python
5
star
16

homebridge-mysqueezebox

Homebridge plugin for sending commands through MySqueezebox
JavaScript
4
star
17

MarcoPolo

MarcoPolo 2.6/3.0b3 with fixed AppleScript support.
Objective-C
4
star
18

ShortcutRecorder

Fork for improved Cocoa bindings support.
Objective-C
4
star
19

StreamVision

iTunes Growl display and keyboard control (and more).
Python
3
star
20

demote

Launch an unelevated Windows process from an elevated Windows process.
C++
3
star
21

Make-Flashcards

Creates & uploads Flashcards Deluxe (http://orangeorapple.com/Flashcards/) compatible output from Google Spreadsheets
Python
2
star
22

LBJumpDesktop

A LaunchBar action for browsing Jump Desktop connections.
Python
2
star
23

wireless_status

Wireless status SwiftBar plugin that doesn't depend on airport.
Swift
1
star
24

iCal-Duplicate

Duplicate an event in iCal into another calendar.
Python
1
star
25

ScanningStatus

Monitor PDFs moving between folders.
Objective-C
1
star
26

FVSpinDown

Scripts to unlock and eject APFS and Core Storage FileVault volumes so external drives spin down.
Python
1
star