Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.
/ darkness Public archive

Conditionally enable dark mode in macOS Mojave based on a time schedule.

Notifications You must be signed in to change notification settings

koenrh/darkness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Darkness

Apple introduced a dark mode in macOS Mojave. Unfortunatly, there is no way to conditionally enable this mode based on a time schedule (or Night Shift). This is a straightforward script that allows you to enable the dark mode based on a predefined window. For example, between 18:00 and 7:00.

Installation

Run the following commands to compile the script, and install it.

mkdir -p $HOME/Library/Scripts/
osacompile -o $HOME/Library/Scripts/darkness.scpt ./darkness.applescript

cp ./com.github.koenrh.darkness.plist $HOME/Library/LaunchAgents/
launchctl load $HOME/Library/LaunchAgents/com.github.koenrh.darkness.plist

Configuration

By default, the dark mode window is set to 7:00 and 18:00.

You could change this window by updating the start and end time (in seconds), which is the second and third argument at the following line in the .plist file , respectively.

...
<string>osascript "$HOME/Library/Scripts/darkness.scpt" 64800 25200</string>
...

About

Conditionally enable dark mode in macOS Mojave based on a time schedule.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published