defaults (software) Usage Settings References Navigation menuNSUserDefaults documentationexpanding ite

MacOS softwareGNUstepCommand-line softwareMacintosh stubs


command lineplistmacOSGNUstepNeXTSTEP~/reverse domain name notationSafariaddress bar





defaults is a command line utility that manipulates plist files. defaults is present in the macOS and GNUstep operating systems, and first appeared in the NeXTSTEP operating system upon which both aforementioned systems are based. The system stores each user's preferences set in a .plist file for each program stored at ~/Library/Preferences for user-specific preferences, and /Library/Preferences/ for global preferences. defaults writes to or reads from these plist files depending on the domain given.


A great advantage of the defaults system, which differentiates it from other systems, is its ability to store data in almost any format imaginable: integer, character string, floating point, binary data, dates, so-called dictionaries, or arrays of the same.


Previous versions also offered the opportunity of direct disk access.



Usage


Common uses of defaults:


$ defaults read DOMAIN # gets all
$ defaults read DOMAIN PROPERTY_NAME # gets
$ defaults write DOMAIN PROPERTY_NAME $VALUE # sets
$ defaults delete DOMAIN PROPERTY_NAME # resets a property
$ defaults delete DOMAIN # resets preferences

DOMAIN should be replaced by the plist file sans extension ('.plist'). plist files are named with reverse domain name notation. For example:


$ defaults read com.apple.iTunes # prints all iTunes preference values

plist files store keys and values. The PROPERTY_NAME key is the name of the property to modify. For example, to remove the search field from Safari's address bar:


$ defaults write com.apple.Safari AddressBarIncludesGoogle 0

or


$ defaults write com.apple.Safari AddressBarIncludesGoogle -bool NO # case-sensitive!

Replacing 0 with 1 or NO with YES or FALSE with TRUE returns the search bar to normal.


Preferences can at times corrupt applications. To reset Address Book's preferences, you would either remove the file ~/Library/Preferences/com.apple.AddressBook.plist or issue the command:


$ defaults delete com.apple.AddressBook


Settings


Some example settings configurable with defaults.










































DomainValueOSX VersionLegal ValuesDefault Values
NSGlobalDomainAppleAquaColorVariant10.81, 61
NSGlobalDomainAppleHighlightColor10.83 floats range 0-1.0"0.780400 0.815700 0.858800"
NSGlobalDomainAppleShowScrollBars10.8Automatic, WhenScrolling, AlwaysAutomatic
NSGlobalDomainNSQuitAlwaysKeepsWindows10.8boolfalse
NSGlobalDomainNSAutomaticWindowAnimationsEnabled10.8booltrue
NSGlobalDomainNSNavPanelExpandedStateForSaveMode10.8boolfalse
NSGlobalDomainNSWindowResizeTime10.8float:time in seconds.2


References



  • NSUserDefaults documentation Apple Inc



Command-line software, GNUstep, Macintosh stubs, MacOS softwareUncategorized

Popular posts from this blog

Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

Word for a person who has no opinion about whether god existsWord for having a definite opinion while simultaneously withholding judgment?What's the opposite of “newcomer? Is ”veteran" OK?What do you call an “atheist” who might believe in an afterlife?What's a word for someone who wants to voice opinions but not have them challenged?Word for someone who dismisses contrary opinions as irrational?Somone who thinks they are overly special/out of the ordinaryIs there a word, phrase or idiom for “a person who is incapable of thinking about the future”?The belief that a god is human-likeA word for a non-famous person/thing you have heard a lot aboutAdjective for a person who enjoys taking care of their appearance

Can I redirect output to a log file and background a process at the same time?2019 Community Moderator ElectionUnable to write to file in shell script when running command in backgroundredirect and log script outputhow to properly log the output of a console program that frequently updates “parts” of the screen, resulting in a messy log file?How can I redirect the output of a child process?grep script - output lines at the same time into echoHow to run process in background and get its pid to create log file nameHow to redirect output to a log from expect commandHow to clear a redirect log file content in shell?Log background jobs started in all the manually started shells?Why do `jobs` and `dirs` run in command subsitution, process substitution, pipeline, and background jobs output the same as in original shell?How to redirect output to file to STDOUT?