Programmatically changing OS X Menu BarReport
I’ve been looking into a script solution to changing the OS X menu bar to Dark theme from the default. I know you can access this setting from the System Preferences > General > use dark theme checkbox, but opening System Preferences takes a little too much time for me. Also, I usually run Flux during the night, but kill it during the day, and Flux automatically force changes the menu bar back to default light style (this is why I’m changing it so often, and why I need a faster solution).
I’ve looked at
man defaults for the Apple OS X system read/write commands, and I finally found the relevant setting:
$ defaults read "Apple Global Domain" AppleInterfaceStyle
if the style is set to dark, or
The domain/default pair of (kCFPreferencesAnyApplication, AppleInterfaceStyle) does not exist
if it’s not (which seems odd that the default would just be an empty attribute).
So I tried:
$ defaults write "Apple Global Domain" AppleInterfaceStyle Dark
This command ‘works’ (it returns with no errors, exit code 0, trying
defaults read alleges that the “Dark” theme has been set) but doesn’t visually change the menu bar or Sherlock style to a dark theme. When I check System Preferences > General the checkbox is still unchecked: even re-launching Finder doesn’t redraw the menu bar with a dark theme.
Is there a different command I should be using instead? I’ve checked out
defaults domains but there doesn’t seem to be other relevant domains I should be modifying. Is there a command to force redraw Finder I don’t know about? Or is this a lost cause?
solved 04 months 1 Answer 38 views 0