Customising it all: global defaults in macOS Sierra and High Sierra

Each user’s default and other settings are stored in three main locations:

  • those for individual apps are kept in their preference files, XML property lists which you should find in ~/Library/Preferences, or /Library/Preferences for those which apply to all users;
  • those for controls within components of macOS are most commonly kept in individual preference files, many of which I have listed in this article;
  • global settings may not appear in user-accessible preferences, and their only access may be through the defaults command, or utilities such as MacPilot, TinkerTool, etc.

Changing those settings is not simple, as I have explained here. The most robust and universal ways are to use the app’s own controls or those provided in panes in System Preferences and elsewhere, as appropriate, or to use the defaults command in Terminal.

Knowing which settings you can change is usually not a problem for those which are stored in accessible property lists and other files, as you can view those files readily, even if editing them directly would not be a wise move. They are not, of course, comprehensive: if an app is still using an internally-set default, that may not have been written to the file, but there is no more general way of discovering exactly what can be set.

Global settings are the biggest problem. Apple doesn’t document them, and using the defaults command you can only see those which have been formally set. Here is a partial list of those known in recent versions of macOS, which may work in Sierra and High Sierra:

  • Apps, disable App Nap for all apps NSAppSleepDisabled -bool true
  • Apps, disable automatic termination of inactive apps NSDisableAutomaticTermination -bool true
  • Displays, enable subpixel font rendering on non-Apple LCDs AppleFontSmoothing -int 2 or 1
  • File save, expand save panel by default NSNavPanelExpandedStateForSaveMode -bool true and NSNavPanelExpandedStateForSaveMode2 -bool true
  • File save, save to disk by default rather than to iCloud NSDocumentSaveNewDocumentsToCloud -bool false
  • Finder, show all filename extensions AppleShowAllExtensions -bool true
  • Interface, action on double-clicking window AppleActionOnDoubleClick -string "Maximize"
  • Interface, always show scrollbars AppleShowScrollBars -string "WhenScrolling" or "Automatic" or "Always"
  • Interface, close always confirms changes NSCloseAlwaysConfirmsChanges -bool true
  • Interface, disable ‘natural’ scrolling -bool false
  • Interface, disable menu bar transparency AppleEnableMenuBarTransparency -bool false
  • Interface, disable opening and closing window animations NSAutomaticWindowAnimationsEnabled -bool false
  • Interface, disable scroller navigation with mouse swipe AppleEnableMouseSwipeNavigateWithScrolls -bool false
  • Interface, disable smooth scrolling NSScrollAnimationEnabled -bool false
  • Interface, disable the over-the-top focus ring animation NSUseAnimatedFocusRing -bool false
  • Interface, enable full keyboard access for all controls AppleKeyboardUIMode -int 3 normal 2
  • Interface, enable spring-loading for directories -bool true
  • Interface, increase window resize speed for Cocoa applications NSWindowResizeTime -float 0.001
  • Interface, miniaturise on double-click AppleMiniaturizeOnDoubleClick -bool true
  • Interface, quit always saves windows NSQuitAlwaysKeepsWindows -bool true
  • Interface, remove the spring loading delay for directories -float 0 standard 0.5
  • Interface, set highlight colour to green AppleHighlightColor -string "0.764700 0.976500 0.568600"
  • Interface, set sidebar icon size to medium NSTableViewDefaultSizeMode -int 2
  • Interface, table view default size NSTableViewDefaultSizeMode -int 2
  • Keyboard, disable press-and-hold for keys in favor of key repeat ApplePressAndHoldEnabled -bool false
  • Keyboard, set a shorter delay until key repeat InitialKeyRepeat -int 12 normal 68
  • Keyboard, set a very fast keyboard repeat rate KeyRepeat -int 1 normal 6
  • Localisation, set locale AppleLocale -string "en_GB@currency=EUR", or "en_GB", or "en_US" etc.
  • Localisation, set measurement units AppleMeasurementUnits -string "Centimeters" or "Inches"
  • Localisation, set metric units AppleMetricUnits -bool true
  • Localisation, set temperature units AppleTemperatureUnit -string "Celsius"
  • Print, expand print panel by default PMPrintingExpandedStateForPrint -bool true and PMPrintingExpandedStateForPrint2 -bool true
  • Sound, disable flash with system beep -bool false
  • Sound, set system beep sound -string "/System/Library/Sounds/Sosumi.aiff"
  • Text, disable auto-correct NSAutomaticSpellingCorrectionEnabled -bool false
  • Text, disable automatic capitalisation NSAutomaticCapitalizationEnabled -bool false
  • Text, disable automatic period substitution NSAutomaticPeriodSubstitutionEnabled -bool false
  • Text, disable automatic text completion NSAutomaticTextCompletionEnabled -bool false
  • Text, disable smart dashes NSAutomaticDashSubstitutionEnabled -bool false
  • Text, disable smart quotes NSAutomaticQuoteSubstitutionEnabled -bool false
  • Text, disable web automatic spelling correction WebAutomaticSpellingCorrectionEnabled -bool false
  • Text, display ASCII control characters using caret notation in standard text views NSTextShowsControlCharacters -bool true
  • Text, spell checker automatically identifies languages NSSpellCheckerAutomaticallyIdentifiesLanguages -bool true
  • Trackpad, enable Force Click -bool true
  • Trackpad, scaling factor -float 1.5
  • Web views, add a contextual menu item for showing the Web Inspector WebKitDeveloperExtras -bool true

To change any of these in Terminal, type a command of the form
defaults write -g settingname type value
where settingname is the name of the setting given above, like WebKitDeveloperExtras, type is the type option such as -bool, and value is the value to set it to, such as true.

When set, check the setting by reading it, using a command of the form
defaults read -g settingname
which should return the setting which you have just made.

So, to set the temperature units to Celsius, first type
defaults write -g AppleTemperatureUnit -string "Celsius"
then check the setting with
defaults read -g AppleTemperatureUnit

Returning any of these to their default setting is just a matter of writing the default value. Apple changes these without warning, sometimes in minor updates to macOS: they can come and go, and may stop working for no apparent reason.

Some settings take immediate effect. Most require the affected apps etc. to be restarted, for example the Finder to be reloaded. A few may require you to log out and back in, or restart, before they work. Others may only apply until you next start your Mac up, when you will need to set them again.

The global defaults also contain some potentially useful information, such as defining whether a FaceTime camera, external USB SuperDrive, or Magic Trackpad are supported:
"Apple Inc. FaceTime HD Camera (Built-in)" -bool true
"Apple Inc. MacBook Air SuperDrive" -bool true
"Apple Inc. Magic Trackpad 2" -bool true

They contain the list of recent locations to use in file save and open dialogs, listed under NSNavRecentPlaces. To save your current global defaults to a text file, use the following in Terminal:
touch DefaultsGlobal.txt
defaults read NSGlobalDomain > DefaultsGlobal.txt

and you can then open DefaultsGlobal.txt.

Many of these defaults are listed at Mathias Bynens’ GitHub, from which I have borrowed freely, and I would also like to acknowledge the help of Michael Tsai in compiling them.