19

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.

Nate
  • 473
  • 3
  • 14

2 Answers2

25

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.

Anonymous User
  • 441
  • 5
  • 5
  • 3
    Hi. Can we override the default temperature max/min? Flux can get really yellow orangey while I find that MacOS NightShift is still too white/bright for late night work. – Edison Feb 06 '18 at 02:33
3

2022 Answer

Try https://github.com/smudge/nightlight, "A CLI for configuring 'Night Shift' on macOS"

Alfred workflow that uses it: https://github.com/shmulvad/alfred-nightshift/

Working for me on macOS Ventura 13.0.1

Ville
  • 1,182
  • 10
  • 16