nightlight-cli
v1.0.0
Published
Control Windows 10/11's Night Light feature programmatically.
Downloads
10
Readme
Night Light CLI 🌓
Control Windows 10/11's Night Light feature programmatically.
The binary format of the registry value was reverse engineered from
NightLight.cs
in the tiny-screen
project
by Maclay74, and converted to Typescript with
help from ChatGPT.
For changing the scheduled Night Light settings via a slightly different registry key, see this post: https://superuser.com/a/1209192.
Compatibility
Windows Version | Status --------------- | ---------- Windows 11 22H2 | ✅ Tested Windows 10 21H2 | ❔ Untested but should work
Please open an issue if you find that this package does not work on your version of Windows.
Contribution
Since this works by modifying a single registry key, it can be done in any language. A few examples are implemented already.
Language | Status ------------ | ------ TypeScript | ✅ CLI (NodeJS) | ✅ C# | ⬆️ upstream Python | ✏️ Open a PR Rust | ✏️ Open a PR Powershell | ✏️ Open a PR Other | ✏️ Open a PR
Getting started (TypeScript)
const nightLight = new NightLight()
console.log('Supported:', nightLight.supported())
console.log('Enabled:', await nightLight.enabled())
console.log('Toggling')
await nightLight.toggle()
console.log('Enabled:', await nightLight.enabled())
Getting started (CLI)
npm i -g nightlight-cli
nightlight toggle
...or...
npx nightlight toggle