nightlight-cli
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i nightlight-cli

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

13.7 kB

Total Files

11

Last publish

Collaborators

  • nbabcock