• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

nriley/brightness: Command-line display brightness control for macOS.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

nriley/brightness

开源软件地址(OpenSource Url):

https://github.com/nriley/brightness

开源编程语言(OpenSource Language):

C 90.4%

开源软件介绍(OpenSource Introduction):

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
[...]



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap