Last active
September 27, 2018 13:50
-
-
Save jhochwald/ae6f511c6b3ed0e938171f6ed3fd86a2 to your computer and use it in GitHub Desktop.
Automate macOS Mojaves dark mode - https://hochwald.net/automate-macos-mojaves-dark-mode/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load then both | |
launchctl load ~/Library/LaunchAgents/Set-DarkMode.plist | |
launchctl load ~/Library/LaunchAgents/Set-LightMode.plist | |
# Unload | |
launchctl unload ~/Library/LaunchAgents/Set-DarkMode.plist | |
launchctl unload ~/Library/LaunchAgents/Set-LightMode.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>net.enatec.Set-DarkMode</string> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>PATH</key> | |
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin</string> | |
</dict> | |
<key>Label</key> | |
<string>Set Dark Mode</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/josh/bin/Set-DarkMode.sh</string> | |
</array> | |
<key>RunAtLoad</key> | |
<false/> | |
<key>StartCalendarInterval</key> | |
<array> | |
<dict> | |
<key>Hour</key> | |
<integer>23</integer> | |
<key>Minute</key> | |
<integer>0</integer> | |
</dict> | |
</array> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- turn on Dark Mode on macOS | |
tell application "System Events" | |
tell appearance preferences | |
set dark mode to true | |
end tell | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Load some defaults | |
. /etc/bashrc | |
PATH=/usr/local/bin:/usr/local/sbin/:/var/root/bin/:$PATH | |
export PATH | |
osascript ~/bin/Set-DarkMode.scpt > /dev/null 2>&1 | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>net.enatec.Set-LightMode</string> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>PATH</key> | |
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin</string> | |
</dict> | |
<key>Label</key> | |
<string>Set Light Mode</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/josh/bin/Set-LightMode.sh</string> | |
</array> | |
<key>RunAtLoad</key> | |
<false/> | |
<key>StartCalendarInterval</key> | |
<array> | |
<dict> | |
<key>Hour</key> | |
<integer>6</integer> | |
<key>Minute</key> | |
<integer>30</integer> | |
</dict> | |
</array> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- turn on Dark Mode on macOS | |
tell application "System Events" | |
tell appearance preferences | |
set dark mode to false | |
end tell | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Load some defaults | |
. /etc/bashrc | |
PATH=/usr/local/bin:/usr/local/sbin/:/var/root/bin/:$PATH | |
export PATH | |
osascript ~/bin/Set-LightMode.scpt > /dev/null 2>&1 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment