This subchapter looks at defaults, a Mac OS X command.
defaults is used to read, write, or delete defaults from a command line shell.
defaults options
Mac OS X programs use the defaults system to record user preferences and other information. Most of the information is more easily accessed through the applications Preferencess panel, but some information is normally inaccessible to the end user.
Note: Since applications do access the defaults system while theyre running, you shouldnt modify the defaults of a running application.
All programs share the defaults in NSGlobalDomain. If the program doesnt have its own default, it uses the value from the NSGlobalDomain.
screencapture defaults
The following methods use Terminal to change the default file format and location where the screenshot is saved from the graphic user interface.
In Mac S X 10.4 (Tiger) or more recent, the default screencapture format can be changed in Terminal by using the defaults command. In Mac S X 10.4 (Tiger), the new default does not take effect until you logout and log back in(from the entire computer, not just from Terminal a full restart will also work) unless you also use the killall command.
$ defaults write com.apple.screencapture type ImageFormat; killall SystemUIServer
The FileFormat can be png (Portable Network Graphic), pdf (Portable Document Format), tiff (Tagged Image File Format), jpg or jpeg (Joint Photographic Experts Group), pict (Macintosh QuickDraw Picture), bmp (Microsoft Windows Bitmap), gif (Graphics Interchange Format), psd (Adobe Photoshop Document), sgi (Silicon Graphics File Format), or tga (Truevision Targe File Format).
JPGs are saved at quality 60%.
To change the default location where the screenshot file is saved (the default is Desktop), use the following Terminal command (where pathname is the full path to a directory.:
Use the following commands to change the 3D Dock of Mac OS X Lion back to the 2D look. The killall restarts the Dock so that the change takes effect right away.
$ defaults write com.apple.dock no-glass -boolean YES; killall Dock
Return to the 3D look with the following commands:
$ defaults write com.apple.dock no-glass -boolean NO; killall Dock
Use the following commands to add a gradient behind an icon in a Dock Stack in Mac OS X:
$ defaults write com.apple.dock mouse-over-hilte-stack -boolean YES; killall Dock
Use the following commands to add a small Exposé button to the upper right of your Mac OS X screen. Clicking on the Exposé button will show all of the windows from the current application (same as the normal F10 default) and option clicking the Exposé button will show all windows from all programs (same as the normal F9 default). This will work even if you reconfigure the F9 and F10 keys to do something else.
$ defaults write com.apple.dock wvous-floater -bool YES; killall Dock
Use the following commands to remove the small Exposé button.
$ defaults write com.apple.dock wvous-floater -bool NO; killall Dock
login defaults
Use the following command to add a message to your Login window. Replace message with a short message. Keep the message short. As always with the sudo command, type very carefully.
The Mac OS X Finder hides all files that start with the period or dot character. This matches the standard behavior of ls in UNIX, where a leading dot is used as an indicator of a hidden file.
To have Finder always show all files, including hidden files, type:
$ defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder
To restore Finder to its default behavior, type:
$ defaults write com.apple.Finder AppleShowAllFiles NO; killall Finder
.DS_Store files
To prevent Mac OS X from creating .DS_Store files on network shares (and everywhere else), type:
A clean system will report The domain/default pair of (/Applications/Safari.app/Contents/Info, LSEnvironment) does not exist. Any other result indicates your computer is infected.
If your computer passes the first test, type the following command (copy and paste into Terminal):
A clean system will report The domain/default pair of (/Users/user-name/.MacOSX/environment, DYLD_INSERT_LIBRARIES) does not exist. Any other result indicates your computer is infected.
If your computer is infected, immediately go to F-Secure.
Downloading the latest security patches from Apple will help prevent infection.
free music player coding example
Coding example: I am making heavily documented and explained open source code for a method to play music for free almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a front-end to YouTube (which checks the copyright permissions for you).
Create your own copy from the original source code/ (presented for learning programming).
Work on this project is very slow because I am homeless. I am available for work if someone can provide an indoor place to work in Costa Mesa, California, electricity, internet connections, a flat raised working surface (such as a table or desk), a sitting device (such as a chair or stool), and a fully functional reasonably modern used computer. Im already homeless, so you dont need to pay me (and I understand how much business people hate the minimum wage law). Just give me a chance to work.
Building a free downloadable text book on computer programming for university, college, community college, and high school classes in computer programming.
If you like the idea of this project, then please donate some money.
send donations to: Milo
PO Box 1361
Tustin, California 92781
At the time I am homeless. This greatly interferes with my ability to create this project, which can help nearly 20 million U.S. college students and more than 150 million students world-wide. I am looking for 30 rich people or corporations willing to donate $10 a month to my church so that the church can provide a place indoors for me to continue work. If you want to donate, please see help project. Thanks much.
Supporting the entire project:
If you have a business or organization that can support the entire cost of this project, please contact Pr Ntr Kmt (my church)
UNIX used as a generic term unless specifically used as a trademark (such as in the phrase UNIX certified). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.
Names and logos of various OSs are trademarks of their respective owners.