From ae903e127babb9a7d640746fc4b336754c5b3c49 Mon Sep 17 00:00:00 2001 From: Oliver Schrenk Date: Sun, 3 Dec 2023 00:25:07 +0100 Subject: [PATCH] Better docs --- DOCS.md | 40 +++++++++++++++++++++++++++++++++++++++ Makefile | 1 + README.md | 56 ++++++++----------------------------------------------- 3 files changed, 49 insertions(+), 48 deletions(-) create mode 100644 DOCS.md diff --git a/DOCS.md b/DOCS.md new file mode 100644 index 0000000..2a10819 --- /dev/null +++ b/DOCS.md @@ -0,0 +1,40 @@ +# DOCS + +> Night Shift automatically shifts the colours of your display to the warmer end of the colour spectrum after dark. This may help you get a better night's sleep. + +Under "System Settings > Display > Night Shift" you find the UI controls. + +It supports three schedules + +1. Off +2. Sunset to Sunrise +3. Custom + +When "Off" (`mode: 0`), you can turn it on for a single day toggling "Turn on until "tomorrow" + +When "Sunset to Sunrise" (`mode: 1`), the schedule is automatic, and you can toggle it active until the next "sunrise" + +When "Custom" (`mode: 2`), you can set a daily schedule, and additionally toggle it active until "tomorrow" + +In all three modes, you can select a colour temperature, on a sliding scale between "Less Warm" and "More Warm" + +## Technical + +The status object + +``` + var status: Status = Status() + client.getBlueLightStatus(&status) +``` + +``` +// seems to control the temporary setting until tomorrow/sunrise +enabled: true|false +available: true|false + +// I guesss this has to do with location based information +sunSchedulePermitted: true|false +disableFlags: 0 +mode: 0|1|2 +schedule(fromTime(hour,minute),toTime(hour,minute)) +``` diff --git a/Makefile b/Makefile index e8c3049..ef17a26 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ install: release uninstall: rm -rf "$(bindir)/$(name)" +# requires `brew install swiftlint` lint: swiftlint diff --git a/README.md b/README.md index 23775c2..15d3607 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,6 @@ # README -A macOS tool to read and control macos Nightshift feature. - -> Night Shift automatically shifts the colours of your display to the warmer end of the colour spectrum after dark. This may help you get a better night's sleep. - -Under "System Settings > Display > Night Shift" you find the UI controls. - -It supports three schedules - -1. Off -2. Sunset to Sunrise -3. Custom - -When "Off" (`mode: 0`), you can turn it on for a single day toggling "Turn on until "tomorrow" - -When "Sunset to Sunrise" (`mode: 1`), the schedule is automatic, and you can toggle it active until the next "sunrise" - -When "Custom" (`mode: 2`), you can set a daily schedule, and additionally toggle it active until "tomorrow" - -In all three modes, you can select a colour temperature, on a sliding scale between "Less Warm" and "More Warm" - -The status object - -``` - var status: Status = Status() - client.getBlueLightStatus(&status) -``` - -``` -active: true|false - -// seems to control the temporary setting until tomorrow/sunrise -enabled: true|false -available: true|false - -// I am guesss this has to do with location based information -sunSchedulePermitted: true|false -disableFlags: 0 -mode: 0|1|2 -schedule(fromTime(hour,minute),toTime(hour,minute)) -``` +A macOS tool to read and control the [Night Shift](https://support.apple.com/en-us/102191) feature. ## Usage @@ -52,11 +13,17 @@ Enabled until tomorrow: true Strength: 0.49 ``` +Control modes + ``` nightshift mode off --temperature 0.4 nightshift mode custom --from 11:00 --to 23:00 --temperature 0.4 nightshift mode sunrise --temperature 0.4 +``` + +Control details +``` nightshift enable nightshift disable nightshift temperature @@ -77,16 +44,9 @@ make install ## Development -**Dependencies** - -``` -brew install swiftlint -``` - - **Build** `make build` - **Run** `make run` - -## Documentation +- **Lint** `make lint` ## Release