Created
October 24, 2020 15:04
-
-
Save piratus/eb16c528cc10120985f04c0d51b43909 to your computer and use it in GitHub Desktop.
Toggle MacOS Dark/Light 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
#!/usr/bin/env osascript -l JavaScript | |
function run(input, parameters) { | |
const appSE = Application("System Events"); | |
appSE.includeStandardAdditions = true; | |
if (appSE.appearancePreferences.darkMode()) { | |
setLightMode(appSE) | |
} else { | |
setDarkMode(appSE) | |
} | |
} | |
function setLightMode(appSE) { | |
appSE.appearancePreferences.darkMode = false; | |
appSE.currentDesktop.picturesFolder = "/Users/andriip/Pictures/Desktop Light" | |
} | |
function setDarkMode(appSE) { | |
appSE.appearancePreferences.darkMode = true; | |
appSE.currentDesktop.picturesFolder = "/Users/andriip/Pictures/Desktop Dark" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment