Terminal command to control Night Shift in macOS
Asked Answered
J

2

21

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.

Jalisajalisco answered 28/2, 2017 at 8:42 Comment(0)
T
26

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.

Thirtythree answered 22/4, 2017 at 5:8 Comment(1)
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.Wyck
R
4

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

Russ answered 21/11, 2022 at 10:23 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.