Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal command to control Night Shift in macOS

Does anyone know of a Terminal command to control Night Shift in the 10.12.4 beta? I've been looking through plist files but can't find anything related to night shift.

like image 220
Nate Avatar asked Feb 28 '17 08:02

Nate


People also ask

What is CTRL C in Mac terminal?

Turned out the way Ctrl-c works is quite simple — it's just a shortcut key for sending the interrupt (terminate) signal SIGINT to the current process running in the foreground.


1 Answers

I was looking for the same thing and didn't have any luck, so I threw together some code for a simple command line tool to control the feature. You can find it here.

It works by making calls to the CoreBrightness private framework. Specifically, it creates an instance of CBBlueLightClient and calls the instance methods setStrength:commit: and setEnabled:.

Usage is nshift strength where strength is a value from 0 to 100. A higher value shifts the color temperature of the display to more warm. A value of 0 disables Night Shift altogether.

like image 95
Anonymous User Avatar answered Oct 21 '22 06:10

Anonymous User