cama900 Posted June 8, 2018 Share Posted June 8, 2018 Hey everybody, I've been testing out macOS Mojave + Dark mode the past few days and wanted to be able to toggle between the light theme and dark theme using alfred. So I made a simple workflow for it. It's probably not useful to most of you yet (as Mojave it's still on dev beta 1) but i'll be making sure it stays working as there are more updates Download Workflow View on Github bivalvegruff and MrAu 2 Link to comment
dfay Posted June 8, 2018 Share Posted June 8, 2018 Actually it looks like the scripting commands are unchanged from Yosemite: Link to comment
cama900 Posted June 8, 2018 Author Share Posted June 8, 2018 Awesome! I hadn't seen that one before. While the AppleScript in the theme does work to toggle between light and dark mode, running the workflow doesn't toggle it for me. I'll have to try and figure out why Link to comment
octothorpe Posted September 28, 2018 Share Posted September 28, 2018 Works great, but also changes my Alfred theme every time as well back to one of Alfred's default themes. How do I make it stop doing that? Link to comment
cama900 Posted September 29, 2018 Author Share Posted September 29, 2018 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
toebba Posted October 1, 2018 Share Posted October 1, 2018 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
cama900 Posted October 1, 2018 Author Share Posted October 1, 2018 I updated the app to make it easier to choose wether or not to toggle the Alfred theme, as well as support for toggling the theme of the Sourcetree app. Download Workflow View on GitHub Chris Messina 1 Link to comment
endrus Posted October 4, 2018 Share Posted October 4, 2018 Hi cama900, Thanks for sharing the WF, just what I was thinking about. Do you have an idea where to get the sunrise / sunset trigger from? Would be interesting to add an automatic trigger to your WF Link to comment
deanishe Posted October 4, 2018 Share Posted October 4, 2018 @endrus Here's a script that can toggle Alfred's theme at sunrise & sunset. You can adjust the AppleScript in it to call this workflow. Link to comment
Starkiller Posted November 9, 2018 Share Posted November 9, 2018 I would love this workflow. But it does not work for me. When I "toggle" or go on "dark" nothing happens. Any idea why? Link to comment
TheDonk Posted November 27, 2018 Share Posted November 27, 2018 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now