Skip to content

Set brightness of display and keyboard backlight from the Terminal in OS X.

License

Notifications You must be signed in to change notification settings

drhaynes/brightness.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brightness.c

Set brightness of display and keyboard backlight from the Terminal in OS X.

Building

gcc -o brightness brightness.c -framework IOKit \
   -framework ApplicationServices -framework CoreFoundation

Usage

$ brightness <float value between 0..1>

E.g.

$ brightness 0.01   # ideal for night-time hacking

Notes

Can be used to set the brightness of the backlights well below the minimum level permitted by the normal function keys. This is especially useful for e.g. setting the keyboard backlight at night (0.01 is a suggested value).

The brightness of Apple displays seems to be hard-limited to approximately 0.0625 (the minimum value possible using the built-in brightness controls). In practical terms, setting a value less than this is permitted, but will not result in the display getting any dimmer.

The keyboard backlight does not appear to have a similar hard limit.

Works on 64-bit machines only, due to use of IOConnectCallScalarMethod.

Inspired by:

About

Set brightness of display and keyboard backlight from the Terminal in OS X.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published