Dark mode is one of the more popular features of OS X Yosemite, because it allows you to add a dark tint to both the dock and the menu bar on Mac. The standard way to enable dark mode involves venturing to System Preferences, opening the General section, and clicking on the enable dark mode option. But wouldn’t it be cool if you could toggle dark mode using a simple keyboard shortcut?
To enable the dark mode keyboard shortcut, do the following:
Step 1: open Terminal
Step 2: paste the following command in the Terminal window:
sudo defaults write /Library/Preferences/.GlobalPreferences.plist _HIEnableThemeSwitchHotKey -bool true
Step 3: press Return on your keyboard and you’ll be asked to enter your administrator password
Step 4: log out of your Mac by going to the Apple menu and clicking Log Out (you can restart if you prefer)
Step 5: log back in and press Control+Option+Command+T to toggle dark mode on or off
Once you enable the dark mode keyboard shortcut, you can use the shortcut permanently going forward. If you ever want to disable the shortcut, simply follow steps 1-4, but replace the word true in step 2 with the word false. So your command would look as follows:
sudo defaults write /Library/Preferences/.GlobalPreferences.plist _HIEnableThemeSwitchHotKey -bool false
I think you’ll find that it’s much easier to use a keyboard shortcut to toggle dark mode on and off than it is to go to System Preferences → General
every time you wish to switch. What do you think?
Credit: iDB Feb 27, 2015