Home > Products > Defaults


 

Defaults

In MacOS X preferences are stored in XML like files called plists. These are text based and human readible. Apple has an application called PropertyListEditor which installs with the developer tools. This is a GUI representation of the plist and is pretty nice for reading and editing plist files. But not everybody installs the developer tools and if you do you have to know there these plist files are stored. Therefore Apple created a little useful command line tool called defaults which lets you read and write these plist files. To use this you have to launch the Terminal application. This is located in the Utilities folder under Applications. This application lets you play with the Unix underpinnings which is the heart of MacOS X.
Only applications which uses the built-in API in MacOS X for preferences will be available with the defaults tool.

To use the defaults tool you need to know some basic commands. Write these in the Terminal window and hit Enter after the command.

defaults domains
This lists all applications/domains which has registered preferences in the defaults system.

defaults read <application/domain, ex com.apple.finder>
This lists all settings for the specified application/domain (the <> characters are not supposed to be included).

defaults write <application/domain, ex com.apple.com> <setting/key, ex FileViewer.Toolbar> <value, ex 0 or 1>
This changes the value for a specific setting for the defined application/domain. The value is often a boolean value (1 or 0) but it could also be a string or a number or a list of other values. (You can write "-boolean yes" instead of 1 or "-boolean no" instead of 0). You need to restart the changed application to see the changes.

defaults domains | defaults read
Gives a list of all the default settings.

You are now ready to change the look and feel of MacOS X. A lot of these settings are available through the UI, like the System Preferences application. But there are a lot of settings which are not obvious, you don't see them when you use the defaults read command. You can find these "hidden" setting by searching for strings in the application packages. This is teadious work and therefore we list the most useful ones here.

Defaults commands

  • defaults write NSGlobalDomain AppleScreenShotFormat <JPEG or TIFF or PNG or PICT>
  • defaults write "Apple Global Domain" AppleScrollBarVariant <DoubleBoth or Single or DoubleMax>
  • defaults write CoreGraphics CGFontDisableAntialiasing <YES or NO>
  • defaults write NSGlobalDomain NSInterfaceStyle <nextstepdefaults or macintoshdefaults or windowsdefaults>
  • write com.apple.finder Desktop.HasLocalVolumes <1 or 0>
  • defaults write com.apple.finder Desktop.HasTrash <1 or 0>
  • defaults write com.apple.terminal TerminalOpaqueness <0.0 to 1.0>
  • defaults write com.apple.finder ZoomRects -bool <yes or no>
  • defaults write com.apple.finder DesktopViewOptions -dict ArrangeBy <dnam or kind or size>
  • defaults write com.apple.dock showhidden -boolean <yes or no>
  • defaults write com.apple.dock showforeground -boolean <yes or no>
  • defaults write NSGlobalDomain NSFixedPitchFontSize <size, ex 14>
  • defaults write NSGlobalDomain NSFontSize <size, ex 14>
  • defaults write NSGlobalDomain NSSystemFontSize <size, ex 14>
  • defaults write com.apple.finder Desktop.HasDarkDesktop <1 or 0>
  • defaults write com.apple.finder Desktop.HasRemovableMedia <1 or 0>
  • defaults write com.apple.finder OpenWindowForNewRemovableDisk <1 or 0>
    - no new window when you insert disk
  • defaults write com.apple.finder CreateDesktop 0
    - no desktop pic
  • defaults write com.apple.dock showforeground 1
    -the little triangle under the dock icon of the active application is painted blue (incontrast to triangles of applications in the background which color remains black)
  • defaults write com.apple.dock showhidden 1
    - the dock icons (and the corresponding triangles underneath) of hidden applications are dimmed (it looks like disabled buttons, but they're still clickable)
  • defaults write com.apple.finder ShowAllFiles True
  • defaults write NSGlobalDomain Desktop.HasDarkBackground <1 or 0>
  • defaults write com.apple.Dock mineffect <genie or suck or scale>
  • defaults write com.apple.Dock showshadow <any value>
  • defaults write NSGlobalDomain AppleSmoothFontsSizeThreshold <point size>

(The < and > characters are not supossed to be included in the final command)

Other useful tips

  • Compressed Window Buffers
    sudo pico /library/preferences/com.apple.windowserver.plist
    (you'll need to enter your admin password in order to proceed)
    Move the cursor down below the first <dict> tag, and paste the following
    text in:
    <key>BackingCompression</key>
    <dict>
    <key>compressionScanTime</key>
    <real>5.000000000000000e+00</real>
    <key>minCompressableSize</key>
    <integer>8193</integer>
    <key>minCompressionRatio</key>
    <real>1.100000023841858e+00</real>
    </dict>
    Then hit Control-X to exit pico (hitting the Y key to save the changes
    before exiting when it asks you), then log out and back in again.

  • Mouse Speed
    Using a terminal, edit the .GlobalPreferences.plist file in your
    ~/Library/Preferences directory. If you're using Pico, for example, type:
    pico ~/Library/Preference/.GlobalPreference.plist
    Once the editor opens, use control-W to search for "scaling". You'll see a couple lines that look like:
    [key]com.apple.mouse.scaling[/key]
    [real]1.700000000000000e+00[/real]
    Change the [real] value to something else,
    then log out and back in again.

  • OS version
    Just type 'sw_vers' and you'll get the info on what version of OS X you've connected to. You can also try the traditional UNIX command, which is 'uname -a', this returns Darwin information on OS X.

If you know any defaults or tips not listed here that you think are useful for others email us at contact@pixits.com so we can post them here on this page.


© Copyright 2000-2001, Pixits.