Originally Posted By: dkmarsh
[or, in deference to ganbustein's point about the undesirability of using killall in this fashion, one can run the following Applescript script instead:

tell application "Dock" to quit
do shell script "defaults write com.apple.dock no-glass -boolean YES"


which works on my Mac (OS X 10.5.8), though since the Dock, once quit, automatically relaunches, it's conceivable that if the shell script were delayed, the relaunching of the Dock would precede it, thus negating any change.]


The Dock is the one exception to the rule. Since it won't stay quit, quitting it doesn't really help. It may even make things worse, by starting a race between how quickly you can update its prefs and how quickly it can read them.

For the Dock only, you have to just take your chances and use kill (or killall). The only mitigating factor is that Dock needs to update its preferences so rarely, basically only when you drag something in/out of the dock, or drag the dock to a different edge of the screen, that it (apparently) can afford to flush every minute change out to disk immediately. It never has any unsaved changes in RAM, and is never writing anything to disk except while your hand is still on the mouse/trackpad from telling it to do something. (I.e., your hand isn't on the keyboard running a command in Terminal.) Apple knows that there are a kajillion instances of "killall Dock" advice out there on the interwebs, and they've (apparently again) hardened it to survive.

At least I hope so.

Finder, on the other hand, is constantly updating its in-memory copies of .DS_Store data, as you navigate your windows from folder to folder and/or change views and window sizes. To be reasonably efficient, it has to flush those changes to disk only occasionally and at unpredictable times.


Assuming that "killall Dock" is safe, you can use it to tease Dock. (You can make it slightly safer by telling Dock to quit, and then proceeding with the game after it comes back. After it quits normally and restarts, you can be sure its pref files are up-to-date, and killing it should be benign.)

The tease has to do with the genie effect as it sucks a window that you're minimizing into the dock. You can put the genie effect into slow motion by holding down the shift key as you click on the yellow minimize button.

In a Terminal window, type the command killall Dock, but don't press return yet. Be sure the window is in a place you can reach quickly. While holding down the shift key, click on the minimize button of some other window. Then, very quickly, click back in the Terminal window and press return. (Alternatively, keep the Terminal window in front, and minimize some window in the background. That way you don't need to click on the Terminal window. The killall Dock command doesn't need to actually be on screen.)

Try it with the Dock on various edges of the screen. Try interacting with the victim windows. (Keyboard navigation helps.)

As a reminder, some pertinent Dock settings are (usual setting is blue):

defaults write com.apple.Dock mineffect -string genie ; killall Dock
defaults write com.apple.Dock mineffect -string suck ; killall Dock
defaults write com.apple.Dock mineffect -string scale ; killall Dock

defaults write com.apple.Dock orientation -string left ; killall Dock
defaults write com.apple.Dock orientation -string right ; killall Dock

defaults write com.apple.Dock orientation -string bottom ; killall Dock
defaults write com.apple.Dock orientation -string top ; killall Dock

defaults write com.apple.Dock pinning -string end ; killall Dock
defaults write com.apple.Dock pinning -string start ; killall Dock

defaults write com.apple.Dock pinning -string middle ; killall Dock

(Darn! orientation top no longer works, at least as of Snow Leopard, and the effect doesn't work with mineffect scale.)

To get your windows back in shape, minimize them again from the Windows menu.

Last edited by ganbustein; 06/20/11 02:39 AM. Reason: Typos in some of the commands