Skip to content

Commit

Permalink
Better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Schrenk committed Dec 2, 2023
1 parent d5c362f commit ae903e1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 48 deletions.
40 changes: 40 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
@@ -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))
```
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ install: release
uninstall:
rm -rf "$(bindir)/$(name)"

# requires `brew install swiftlint`
lint:
swiftlint

Expand Down
56 changes: 8 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -77,16 +44,9 @@ make install

## Development

**Dependencies**

```
brew install swiftlint
```

- **Build** `make build`
- **Run** `make run`

## Documentation
- **Lint** `make lint`

## Release

Expand Down

0 comments on commit ae903e1

Please sign in to comment.