Skip to content

Instantly share code, notes, and snippets.

@andrewodri
Last active May 23, 2022 18:15
Show Gist options
  • Save andrewodri/08eddaaf433a40374f84c6bdf04f95f3 to your computer and use it in GitHub Desktop.
Save andrewodri/08eddaaf433a40374f84c6bdf04f95f3 to your computer and use it in GitHub Desktop.
Force dark mode in High Sierra
#!/bin/bash
# https://www.howtogeek.com/fyi/enable-dark-mode-in-high-sierra-sort-of/
# https://medium.com/@n1kk/how-to-tweak-macos-mojave-dark-mode-per-app-a5fab0574691
# https://stackoverflow.com/questions/52562383/is-there-a-way-to-toggle-dark-mode-on-off-for-individual-apps-in-macos-mojave
defaults write -g NSWindowDarkChocolate -bool TRUE
defaults write -g NSRequiresAquaSystemAppearance -bool FALSE
defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool FALSE
defaults write com.google.Chrome _NSSystemAppearanceOverride DarkAppearance
defaults write com.apple.dt.Xcode _NSSystemAppearanceOverride DarkAppearance
# Or, you can use the following for "simulated" dark mode...
# Color codes taken from: https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --install-autogenerated-theme ""
@antoniorrm
Copy link

how to unistall?

@andrewodri
Copy link
Author

@antoniorrm Hmm, good question... These were just some notes I kinda kept to play around with 😬

However, this should work; for the boolean values, just set them back to the opposite boolean. For the _NSSystemAppearanceOverride values, you can use the delete command. You should end up with something like this::

defaults write -g NSWindowDarkChocolate -bool FALSE
defaults write -g NSRequiresAquaSystemAppearance -bool TRUE
defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool TRUE
defaults delete com.google.Chrome _NSSystemAppearanceOverride
defaults delete com.apple.dt.Xcode _NSSystemAppearanceOverride

You may need to delete the globals up top as well... I've since upgraded to Catalina so I can't test any of these!

@thomasthepicness
Copy link

When I tried to use the 4th command or 5th it says Domain (com.google.Chrome) was not found. Defaults have not changed. Anyone help? I'm stuck with this dark mode and I really wanna remove it.

@allyouaskfor
Copy link

Maybe you don't have Google Chrome installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment