Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/katernet/darkmode
Set macOS dark mode and Alfred dark theme at sunset
https://github.com/katernet/darkmode
alfred darkmode launchd macos mojave shell sunset
Last synced: 4 days ago
JSON representation
Set macOS dark mode and Alfred dark theme at sunset
- Host: GitHub
- URL: https://github.com/katernet/darkmode
- Owner: katernet
- License: gpl-3.0
- Archived: true
- Created: 2018-03-07T11:41:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T12:54:08.000Z (over 4 years ago)
- Last Synced: 2024-08-03T01:39:24.454Z (3 months ago)
- Topics: alfred, darkmode, launchd, macos, mojave, shell, sunset
- Language: Shell
- Homepage:
- Size: 263 KB
- Stars: 150
- Watchers: 10
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# darkmode
Set macOS dark mode at sunset. If you have Alfred installed, the dark theme will also be set.
This shell script gets the sunrise and sunset times from Night Shift and automates the setting up of two user launch agents for sunrise and sunset, which then take over running the script thereafter. If your mac was asleep/off during the solar times, launchd will run the script when you're next logged in!
Or you can supply your own sunrise and sunset 24H times by passing arguments. Example: 0600 1800
News: macOS Catalina includes an 'auto' Dark Mode and the new version of Alfred remembers the theme set for light/dark mode and so basically there's no point in using this 😋. However, if you're on an earlier macOS release or you're a fan of setting your own Dark Mode schedules, then this is just for you!
##### Mojave and later
![Mojave](resources/mojave.gif "Mojave Dark Mode")##### High Sierra and below
![HighSierra](resources/highsierra.gif "High Sierra dark menu bar and dock")### Usage
```
$ ./darkmode.shOR
$ ./darkmode.sh HHMM HHMM
```### Notes
Compatible with macOS Mojave and later Dark Mode. Press OK to the security dialogs to allow control to System Events that appear when first running the script.
Night Shift requires Wifi and "Setting Timezone" enabled in System Preferences > Security & Privacy > Location Services > System Services > Details.
If your Mac does not support Night Shift, please use the previous version [1.7.2](https://github.com/katernet/darkmode/releases/tag/1.7.2) which uses the Yahoo Weather API.
If you have a custom Alfred theme, you can change the name of the themes in the global variables.
A log file is stored in ~/Library/Logs which logs solar time changes and script errors.
To uninstall: ```$ ./darkmode.sh /u```