Any way to lock the dock?

Is there any way to lock the dock so it can't be changed? Every so often one of my kids drags an icon from the dock and I have to add it again.

Imac 20", Mac OS X (10.5.2)

Posted on May 16, 2008 12:25 PM

Reply
12 replies

May 16, 2008 12:29 PM in response to talsop

Set up an account just for your kids to use (or any account that does not have Administrator privileges), log into that account and set up the Dock the way you want it to be. Then from your account, go to the Parental Controls system preference, unlock the preference, select your kids' account, and on the System tab uncheck the box that says "Can modify the Dock".

Regards.

Message was edited by: Dave Sawyer

May 16, 2008 1:02 PM in response to talsop

You can't set parental controls for an account with Administrator privileges; by definition such accounts have (and must have) all privileges. It's a really bad idea, in my opinion, to have your kids using an account with admin privileges in any case.

EDIT: VK has an answer for you if you really don't want to set up a separate account your kids. I still think that would be a good idea, but VK's method will work, though of course you'll have to unlock the Dock anytime you want to change it for yourself.

Regards.

Message was edited by: Dave Sawyer

May 16, 2008 1:50 PM in response to talsop

I wonder if it would be easier to just make a copy of the dock plist file, and drag it back to the preferences folder whenever you discover the kids have been at it again. It's at ~/Library/Preferences/com.apple.dock.plist (and there's a com.apple.dock.db file there as well, though I don't know if you'd need to copy that one as well).

But aside from that, having 2 kids myself, I'd say it was a very bad idea to let them use my main admin account. They change things ALL the time.

May 16, 2008 2:53 PM in response to V.K.

and here is an apple script to toggle the lock on Dock on/off. Paste it into Script Editor and save it as an application.
\\


<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
try
set x to do shell script "defaults read com.apple.dock contents-immutable"
if (x is equal to "0") then
do shell script "defaults write com.apple.dock contents-immutable -bool true; sleep 1; killall Dock"
else
do shell script "defaults write com.apple.dock contents-immutable -bool false; sleep 1; killall Dock"
end if
on error
do shell script "defaults write com.apple.dock contents-immutable -bool true; sleep 1; killall Dock"

end try
</pre>

Jul 17, 2008 11:42 AM in response to talsop

if you copy and paste the following into terminal it will lock your toolbar:

defaults write com.apple.dock contents-immutable -bool true

then follow it with this to execute the command:

osascript -e 'tell application "Dock" to quit'

to unlock the toolbar back to normal so you can add or remove more icons:

defaults delete com.apple.dock contents-immutable

then follow it with this to execute the command:

osascript -e 'tell application "Dock" to quit'

hope this helps 😉

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Any way to lock the dock?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.