Restart the dock script

Apr 22, '01 02:39:01PM

Contributed by: Lally

[Editor's note: See the comments for a better solution, as well as a GUI-based way of doing this]

Sometimes the desktop will do something stupid - like leave some of the 'poof' effect on the screen or whatever else. The best thing to do is just restart it. Killing it will make it automatically restart. Here's a little unix script to find it's process ID & kill it:

#!/bin/sh
DOCKPID=`ps aucx| grep Dock | grep -v Server | cut -d ' ' -f 4-5`
kill $DOCKPID
Type this script in your favorite editor (command line or GUI), save it (as PLAINTEXT) to a file, say Desktop/dock.restart. Then, make it executable by doing this in a terminal:
chmod +x dock.restart
Then, double click it in the finder. It'll ask you to choose an application to use to run it. Select Terminal as the program to run it. You'll probably have to make it show you all applications in order for that to be selectable.

After that, just double click it whenever the dock is being stupid!!

Comments (11)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2001042214390132