sfsam / Itsycal

Itsycal is a tiny calendar for your Mac's menu bar. http://www.mowglii.com/itsycal
MIT License
3.3k stars 235 forks source link

Sync Light and Dark theme with macOS Dark Mode #75

Closed diegobit closed 4 years ago

diegobit commented 6 years ago

It would be nice to be able to toggle macOS dark mode and to have Itsycal change it by itself.

buffaloseven commented 6 years ago

I agree it would be nice; in the meantime, I've hacked a solution together.

I use a workflow in Alfred app that runs an AppleScript when triggered by a hotkey to swap between macOS light/dark themes. I've simply added a couple lines to change the Itsycal theme at the same time:

    do shell script "defaults write com.mowglii.ItsycalApp ThemeIndex -int 0"

...sets Itsycal to the light theme and...

    do shell script "defaults write com.mowglii.ItsycalApp ThemeIndex -int 1"

...sets it to the dark theme. I've coordinated this with the OS theme swapping and it all matches nicely.

Obviously, this only works if triggered by the hotkey, but that's so convenient I never go into the system settings any more to swap between them.

diegobit commented 6 years ago

Thank you for the detailed answer! I use Alfred with a similar workflow too, but I haven’t thought about changing the preferences directly. I’ll add this to my workflow.