Jump to content

macOS Mojave Theme (Dark mode) switcher

Recommended Posts

  • 3 months later...

Yep, you can open the workflow and edit the Run Script element. Right at the top there's 2 lines that say

var alfredLightTheme = "Alfred"
var alfredDarkTheme = "Alfred Dark"

You can change them to whatever theme you want for when the mac is in light/dark mode. Just put them both to the same theme name if you want it to always be the same.


I may be adding support for other apps and I'll make the process better if I do. 

Link to comment

This is the script completely without the Alfred theme switching part:


function run(args) {
	args = args ? args : []
	var systemEvents = Application("System Events")
	if (args && args == 'dark') {
		systemEvents.appearancePreferences.darkMode = true
	} else if (args && args == 'light') {
		systemEvents.appearancePreferences.darkMode = false
	} else {
		systemEvents.appearancePreferences.darkMode = !systemEvents.appearancePreferences.darkMode()


Link to comment
  • 1 month later...
  • 3 weeks later...

I'm trying to extend this workflow to change the wallpaper with it. Does anyone know how to apply the new desktop picture to all spaces?


Atm my script looks like


set theQuery to argv
	set thePath to "~/Dropbox/Pictures/" & theQuery & ".png"

	tell application "System Events"
		tell every desktop
			set picture to POSIX file thePath
		end tell
	end tell
	do shell script "killall Dock"
end run


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...